DEV: Update test to pass if the assignments tab is either a link or a button. (#131)
Related to https://github.com/discourse/discourse/pull/11789
This commit is contained in:
parent
e8903a7352
commit
30c1ef0d02
|
@ -1,8 +1,7 @@
|
||||||
import { acceptance, updateCurrentUser } from "discourse/tests/helpers/qunit-helpers";
|
import { acceptance, updateCurrentUser, queryAll } from "discourse/tests/helpers/qunit-helpers";
|
||||||
import { default as AssignedTopics } from "../fixtures/assigned-topics-fixtures";
|
import { default as AssignedTopics } from "../fixtures/assigned-topics-fixtures";
|
||||||
|
|
||||||
const USER_MENU = "#current-user.header-dropdown-toggle";
|
const USER_MENU = "#current-user.header-dropdown-toggle";
|
||||||
const QUICK_ACCESS_ASSIGNMENTS_TAB = ".widget-link.assigned";
|
|
||||||
|
|
||||||
acceptance("Quick access assignments panel", function (needs) {
|
acceptance("Quick access assignments panel", function (needs) {
|
||||||
needs.user();
|
needs.user();
|
||||||
|
@ -20,13 +19,20 @@ acceptance("Quick access assignments panel", function (needs) {
|
||||||
await visit("/");
|
await visit("/");
|
||||||
await click(USER_MENU);
|
await click(USER_MENU);
|
||||||
|
|
||||||
await click(QUICK_ACCESS_ASSIGNMENTS_TAB);
|
// TODO: Remove when 2.7 gets released
|
||||||
|
let quickAccessAssignmentsTab = ".widget-button.assigned";
|
||||||
|
|
||||||
|
if (queryAll(quickAccessAssignmentsTab).length == 0) {
|
||||||
|
quickAccessAssignmentsTab = ".widget-link.assigned";
|
||||||
|
}
|
||||||
|
|
||||||
|
await click(quickAccessAssignmentsTab);
|
||||||
const assignment = find(".quick-access-panel li a")[0];
|
const assignment = find(".quick-access-panel li a")[0];
|
||||||
|
|
||||||
assert.ok(assignment.innerText.includes("Greetings!"));
|
assert.ok(assignment.innerText.includes("Greetings!"));
|
||||||
assert.ok(assignment.href.includes("/t/greetings/10/5"));
|
assert.ok(assignment.href.includes("/t/greetings/10/5"));
|
||||||
|
|
||||||
await click(QUICK_ACCESS_ASSIGNMENTS_TAB);
|
await click(quickAccessAssignmentsTab);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
currentPath(),
|
currentPath(),
|
||||||
"user.userActivity.assigned",
|
"user.userActivity.assigned",
|
||||||
|
|
Loading…
Reference in New Issue