diff --git a/test/javascripts/integration/components/group-assigned-filter-test.gjs b/test/javascripts/integration/components/group-assigned-filter-test.gjs new file mode 100644 index 00000000..e0cf5503 --- /dev/null +++ b/test/javascripts/integration/components/group-assigned-filter-test.gjs @@ -0,0 +1,32 @@ +import { render } from "@ember/test-helpers"; +import { module, test } from "qunit"; +import { setupRenderingTest } from "discourse/tests/helpers/component-test"; +import GroupAssignedFilter from "discourse/plugins/discourse-assign/discourse/components/group-assigned-filter"; + +module( + "Discourse Assign | Integration | Component | group-assigned-filter", + function (hooks) { + setupRenderingTest(hooks); + + test("displays username and name", async function (assert) { + const filter = { + id: 2, + username: "Ahmed", + name: "Ahmed Gagan", + avatar_template: "/letter_avatar_proxy/v4/letter/a/8c91f0/{size}.png", + title: "trust_level_0", + last_posted_at: "2020-06-22T10:15:54.532Z", + last_seen_at: "2020-07-07T11:55:59.437Z", + added_at: "2020-06-22T09:55:31.692Z", + timezone: "Asia/Calcutta", + }; + + await render(); + + assert.dom(".assign-username").hasText("Ahmed"); + assert.dom(".assign-name").hasText("Ahmed Gagan"); + }); + } +); diff --git a/test/javascripts/integration/components/group-assigned-filter-test.js b/test/javascripts/integration/components/group-assigned-filter-test.js deleted file mode 100644 index 6472301a..00000000 --- a/test/javascripts/integration/components/group-assigned-filter-test.js +++ /dev/null @@ -1,35 +0,0 @@ -import hbs from "htmlbars-inline-precompile"; -import componentTest, { - setupRenderingTest, -} from "discourse/tests/helpers/component-test"; -import { discourseModule, query } from "discourse/tests/helpers/qunit-helpers"; - -discourseModule( - "Discourse Assign | Integration | Component | group-assigned-filter", - function (hooks) { - setupRenderingTest(hooks); - - componentTest("displays username and name", { - template: hbs``, - - beforeEach() { - this.set("filter", { - id: 2, - username: "Ahmed", - name: "Ahmed Gagan", - avatar_template: "/letter_avatar_proxy/v4/letter/a/8c91f0/{size}.png", - title: "trust_level_0", - last_posted_at: "2020-06-22T10:15:54.532Z", - last_seen_at: "2020-07-07T11:55:59.437Z", - added_at: "2020-06-22T09:55:31.692Z", - timezone: "Asia/Calcutta", - }); - }, - - test(assert) { - assert.strictEqual(query(".assign-username").innerText, "Ahmed"); - assert.strictEqual(query(".assign-name").innerText, "Ahmed Gagan"); - }, - }); - } -); diff --git a/test/javascripts/integrations/components/group-assigned-filter-test.js b/test/javascripts/integrations/components/group-assigned-filter-test.js deleted file mode 100644 index 6472301a..00000000 --- a/test/javascripts/integrations/components/group-assigned-filter-test.js +++ /dev/null @@ -1,35 +0,0 @@ -import hbs from "htmlbars-inline-precompile"; -import componentTest, { - setupRenderingTest, -} from "discourse/tests/helpers/component-test"; -import { discourseModule, query } from "discourse/tests/helpers/qunit-helpers"; - -discourseModule( - "Discourse Assign | Integration | Component | group-assigned-filter", - function (hooks) { - setupRenderingTest(hooks); - - componentTest("displays username and name", { - template: hbs``, - - beforeEach() { - this.set("filter", { - id: 2, - username: "Ahmed", - name: "Ahmed Gagan", - avatar_template: "/letter_avatar_proxy/v4/letter/a/8c91f0/{size}.png", - title: "trust_level_0", - last_posted_at: "2020-06-22T10:15:54.532Z", - last_seen_at: "2020-07-07T11:55:59.437Z", - added_at: "2020-06-22T09:55:31.692Z", - timezone: "Asia/Calcutta", - }); - }, - - test(assert) { - assert.strictEqual(query(".assign-username").innerText, "Ahmed"); - assert.strictEqual(query(".assign-name").innerText, "Ahmed Gagan"); - }, - }); - } -);