DEV: Remove isLegacyEmber (#355)

This commit is contained in:
Isaac Janzen 2022-06-23 11:06:16 -05:00 committed by GitHub
parent 50adb646f3
commit 507060b7f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 38 deletions

View File

@ -1,14 +1,11 @@
import I18n from "I18n";
import { click, currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit";
import {
acceptance,
conditionalTest,
exists,
query,
} from "discourse/tests/helpers/qunit-helpers";
import { isLegacyEmber } from "discourse-common/config/environment";
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
import { cloneJSON } from "discourse-common/lib/object";
@ -17,18 +14,14 @@ acceptance(
function (needs) {
needs.user({ experimental_sidebar_enabled: true, can_assign: false });
conditionalTest(
"assign sidebar link is hidden",
!isLegacyEmber(),
async function (assert) {
await visit("/");
test("assign sidebar link is hidden", async function (assert) {
await visit("/");
assert.ok(
!exists(".sidebar-section-link-assigned"),
"it does not display the assign link in sidebar"
);
}
);
assert.ok(
!exists(".sidebar-section-link-assigned"),
"it does not display the assign link in sidebar"
);
});
}
);
@ -41,31 +34,27 @@ acceptance("Discourse Assign | Sidebar when user can assign", function (needs) {
server.get(messagesPath, () => helper.response(cloneJSON(assigns)));
});
conditionalTest(
"clicking on assign link",
!isLegacyEmber(),
async function (assert) {
await visit("/");
test("clicking on assign link", async function (assert) {
await visit("/");
assert.strictEqual(
query(".sidebar-section-link-assigned").textContent.trim(),
I18n.t("sidebar.assigned_link_text"),
"displays the right text for the link"
);
assert.strictEqual(
query(".sidebar-section-link-assigned").textContent.trim(),
I18n.t("sidebar.assigned_link_text"),
"displays the right text for the link"
);
assert.strictEqual(
query(".sidebar-section-link-assigned").title,
I18n.t("sidebar.assigned_link_title"),
"displays the right title for the link"
);
assert.strictEqual(
query(".sidebar-section-link-assigned").title,
I18n.t("sidebar.assigned_link_title"),
"displays the right title for the link"
);
await click(".sidebar-section-link-assigned");
await click(".sidebar-section-link-assigned");
assert.strictEqual(
currentURL(),
"/u/eviltrout/activity/assigned",
"it navigates to the right page"
);
}
);
assert.strictEqual(
currentURL(),
"/u/eviltrout/activity/assigned",
"it navigates to the right page"
);
});
});