Retry: Rename all test files from JS -> ES6

This commit is contained in:
Robin Ward
2020-03-26 12:22:33 -04:00
parent 739430c01e
commit 60df2ade8d
281 changed files with 36 additions and 29 deletions

View File

@ -0,0 +1,49 @@
import { afterRender } from "discourse-common/utils/decorators";
import Component from "@ember/component";
import componentTest from "helpers/component-test";
const fooComponent = Component.extend({
layoutName: "foo-component",
classNames: ["foo-component"],
baz: null,
didInsertElement() {
this._super(...arguments);
this.setBaz(1);
},
willDestroyElement() {
this._super(...arguments);
this.setBaz(2);
},
@afterRender
setBaz(baz) {
this.set("baz", baz);
}
});
moduleForComponent("utils:decorators", { integration: true });
componentTest("afterRender", {
template: "{{foo-component baz=baz}}",
beforeEach() {
this.registry.register("component:foo-component", fooComponent);
this.set("baz", 0);
},
test(assert) {
assert.ok(exists(document.querySelector(".foo-component")));
assert.equal(this.baz, 1);
this.clearRender();
assert.ok(!exists(document.querySelector(".foo-component")));
assert.equal(this.baz, 1);
}
});