In newer Embers jQuery is removed. There is a `find` but it only returns one element and not a jQuery selector. This patch migrates our code to a new helper `queryAll` which allows us to remove the global.
19 lines
580 B
JavaScript
19 lines
580 B
JavaScript
import { queryAll } from "discourse/tests/helpers/qunit-helpers";
|
|
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(queryAll(`button.share`).length, "it has all the classes");
|
|
|
|
assert.ok(
|
|
queryAll('button[data-share-url="https://eviltrout.com"]').length,
|
|
"it has the data attribute for sharing"
|
|
);
|
|
},
|
|
});
|