mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
DEV: Update section-link-test to ignore order of classes
This commit is contained in:
parent
e27966c944
commit
e381a55533
@ -6,6 +6,14 @@ import { render } from "@ember/test-helpers";
|
|||||||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||||
import { query } from "discourse/tests/helpers/qunit-helpers";
|
import { query } from "discourse/tests/helpers/qunit-helpers";
|
||||||
|
|
||||||
|
function containsExactly(assert, expectation, actual, message) {
|
||||||
|
assert.deepEqual(
|
||||||
|
Array.from(expectation).sort(),
|
||||||
|
Array.from(actual).sort(),
|
||||||
|
message
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
module("Integration | Component | sidebar | section-link", function (hooks) {
|
module("Integration | Component | sidebar | section-link", function (hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
@ -14,9 +22,15 @@ module("Integration | Component | sidebar | section-link", function (hooks) {
|
|||||||
|
|
||||||
await render(template);
|
await render(template);
|
||||||
|
|
||||||
assert.strictEqual(
|
containsExactly(
|
||||||
query("a").className,
|
assert,
|
||||||
"sidebar-section-link sidebar-section-link-test sidebar-row ember-view",
|
query("a").classList,
|
||||||
|
[
|
||||||
|
"ember-view",
|
||||||
|
"sidebar-row",
|
||||||
|
"sidebar-section-link",
|
||||||
|
"sidebar-section-link-test",
|
||||||
|
],
|
||||||
"has the right class attribute for the link"
|
"has the right class attribute for the link"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -26,9 +40,17 @@ module("Integration | Component | sidebar | section-link", function (hooks) {
|
|||||||
|
|
||||||
await render(template);
|
await render(template);
|
||||||
|
|
||||||
assert.strictEqual(
|
containsExactly(
|
||||||
query("a").className,
|
assert,
|
||||||
"sidebar-section-link sidebar-section-link-test sidebar-row 123 abc ember-view",
|
query("a").classList,
|
||||||
|
[
|
||||||
|
"123",
|
||||||
|
"abc",
|
||||||
|
"ember-view",
|
||||||
|
"sidebar-row",
|
||||||
|
"sidebar-section-link",
|
||||||
|
"sidebar-section-link-test",
|
||||||
|
],
|
||||||
"has the right class attribute for the link"
|
"has the right class attribute for the link"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user