We used many global functions to handle tests when they should be imported like other libraries in our application. This also gets us closer to the way Ember CLI prefers our tests to be laid out.
29 lines
710 B
JavaScript
29 lines
710 B
JavaScript
import { moduleForComponent } from "ember-qunit";
|
|
import { configureEyeline } from "discourse/lib/eyeline";
|
|
import componentTest from "discourse/tests/helpers/component-test";
|
|
|
|
moduleForComponent("load-more", { integration: true });
|
|
|
|
componentTest("updates once after initialization", {
|
|
template: `
|
|
{{#load-more selector=".numbers tr" action=loadMore}}
|
|
<table class="numbers"><tr></tr></table>
|
|
{{/load-more}}`,
|
|
|
|
beforeEach() {
|
|
this.set("loadMore", () => this.set("loadedMore", true));
|
|
configureEyeline({
|
|
skipUpdate: false,
|
|
rootElement: "#ember-testing",
|
|
});
|
|
},
|
|
|
|
afterEach() {
|
|
configureEyeline();
|
|
},
|
|
|
|
test(assert) {
|
|
assert.ok(this.loadedMore);
|
|
},
|
|
});
|