Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 215e1e3

Browse files
authored
DEV: fix specs with new mobile footer UI (#619)
Dependent on discourse/discourse#30132 getting merged. The UI for the "hidden" topic footer buttons on mobile changes from SelectKit to DMenu, so the specs needed to be updated as such.
1 parent d2454e9 commit 215e1e3

File tree

5 files changed

+13
-37
lines changed

5 files changed

+13
-37
lines changed

assets/stylesheets/assigns.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,6 @@
159159
}
160160
}
161161

162-
#topic-footer-button-assign {
163-
padding-top: 0.35em;
164-
padding-bottom: 0.35em;
165-
.d-button-label {
166-
.avatar {
167-
margin-right: 0.25em;
168-
}
169-
}
170-
}
171-
172162
#topic-footer-dropdown-reassign {
173163
.name {
174164
font-weight: normal;
@@ -196,7 +186,6 @@
196186
}
197187

198188
// Group assigns sidebar nav
199-
200189
.group-assignments {
201190
// a little extra space for long names
202191
min-width: 250px;
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { visit } from "@ember/test-helpers";
1+
import { click, visit } from "@ember/test-helpers";
22
import { test } from "qunit";
33
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
4-
import selectKit from "discourse/tests/helpers/select-kit-helper";
54

65
acceptance("Discourse Assign | Assign disabled mobile", function (needs) {
76
needs.user({ can_assign: true });
@@ -10,10 +9,7 @@ acceptance("Discourse Assign | Assign disabled mobile", function (needs) {
109

1110
test("Footer dropdown does not contain button", async function (assert) {
1211
await visit("/t/internationalization-localization/280");
13-
14-
const menu = selectKit(".topic-footer-mobile-dropdown");
15-
await menu.expand();
16-
17-
assert.false(menu.rowByValue("assign").exists());
12+
await click(".topic-footer-mobile-dropdown-trigger");
13+
assert.dom(".assign").doesNotExist();
1814
});
1915
});

test/javascripts/acceptance/assign-enabled-test.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,14 @@ acceptance("Discourse Assign | Assign mobile", function (needs) {
3939
test("Footer dropdown contains button", async function (assert) {
4040
updateCurrentUser({ can_assign: true });
4141
await visit("/t/internationalization-localization/280");
42-
const menu = selectKit(".topic-footer-mobile-dropdown");
43-
await menu.expand();
44-
45-
assert.true(menu.rowByValue("assign").exists());
46-
await menu.selectRowByValue("assign");
42+
await click(".topic-footer-mobile-dropdown-trigger");
43+
await click(".assign");
4744
assert.dom(".assign.d-modal").exists("assign modal opens");
4845
});
4946
});
5047

5148
acceptance("Discourse Assign | Assign desktop", function (needs) {
52-
needs.user({
53-
can_assign: true,
54-
});
49+
needs.user({ can_assign: true });
5550
needs.settings({ glimmer_post_menu_mode: "enabled", assign_enabled: true });
5651

5752
needs.pretender((server, helper) => {

test/javascripts/acceptance/assign-enabled-widget-post-menu-test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ acceptance(
4545
test("Footer dropdown contains button", async function (assert) {
4646
updateCurrentUser({ can_assign: true });
4747
await visit("/t/internationalization-localization/280");
48-
const menu = selectKit(".topic-footer-mobile-dropdown");
49-
await menu.expand();
50-
51-
assert.true(menu.rowByValue("assign").exists());
52-
await menu.selectRowByValue("assign");
48+
await click(".topic-footer-mobile-dropdown-trigger");
49+
await click(".assign");
5350
assert.dom(".assign.d-modal").exists("assign modal opens");
5451
});
5552
}

test/javascripts/acceptance/assigned-topic-test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { visit } from "@ember/test-helpers";
1+
import { click, visit } from "@ember/test-helpers";
22
import { test } from "qunit";
33
import topicFixtures from "discourse/tests/fixtures/topic";
44
import {
@@ -220,14 +220,13 @@ acceptance("Discourse Assign | Reassign topic | mobile", function (needs) {
220220

221221
test("Mobile Footer dropdown contains reassign buttons", async function (assert) {
222222
updateCurrentUser({ can_assign: true });
223-
const menu = selectKit(".topic-footer-mobile-dropdown");
224223

225224
await visit("/t/assignment-topic/44");
226-
await menu.expand();
225+
await click(".topic-footer-mobile-dropdown-trigger");
227226

228-
assert.true(menu.rowByValue("unassign-mobile").exists());
229-
assert.true(menu.rowByValue("reassign-mobile").exists());
230-
assert.true(menu.rowByValue("reassign-self-mobile").exists());
227+
assert.dom("#topic-footer-button-unassign-mobile").exists();
228+
assert.dom("#topic-footer-button-reassign-self-mobile").exists();
229+
assert.dom("#topic-footer-button-reassign-mobile").exists();
231230
});
232231
});
233232

0 commit comments

Comments
 (0)