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.
18 lines
506 B
JavaScript
18 lines
506 B
JavaScript
import { moduleForComponent } from "ember-qunit";
|
|
import componentTest from "discourse/tests/helpers/component-test";
|
|
|
|
moduleForComponent("share-button", { integration: true });
|
|
|
|
componentTest("share button", {
|
|
template: '{{share-button url="https://eviltrout.com"}}',
|
|
|
|
test(assert) {
|
|
assert.ok(find(`button.share`).length, "it has all the classes");
|
|
|
|
assert.ok(
|
|
find('button[data-share-url="https://eviltrout.com"]').length,
|
|
"it has the data attribute for sharing"
|
|
);
|
|
},
|
|
});
|