Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: fix specs with new mobile footer UI #619

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions assets/stylesheets/assigns.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@
}
}

#topic-footer-button-assign {
padding-top: 0.35em;
padding-bottom: 0.35em;
.d-button-label {
.avatar {
margin-right: 0.25em;
}
}
}

#topic-footer-dropdown-reassign {
.name {
font-weight: normal;
Expand Down Expand Up @@ -196,7 +186,6 @@
}

// Group assigns sidebar nav

.group-assignments {
// a little extra space for long names
min-width: 250px;
Expand Down
10 changes: 3 additions & 7 deletions test/javascripts/acceptance/assign-disabled-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { visit } from "@ember/test-helpers";
import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";

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

test("Footer dropdown does not contain button", async function (assert) {
await visit("/t/internationalization-localization/280");

const menu = selectKit(".topic-footer-mobile-dropdown");
await menu.expand();

assert.false(menu.rowByValue("assign").exists());
await click(".topic-footer-mobile-dropdown-trigger");
assert.dom(".assign").doesNotExist();
});
});
11 changes: 3 additions & 8 deletions test/javascripts/acceptance/assign-enabled-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ acceptance("Discourse Assign | Assign mobile", function (needs) {
test("Footer dropdown contains button", async function (assert) {
updateCurrentUser({ can_assign: true });
await visit("/t/internationalization-localization/280");
const menu = selectKit(".topic-footer-mobile-dropdown");
await menu.expand();

assert.true(menu.rowByValue("assign").exists());
await menu.selectRowByValue("assign");
await click(".topic-footer-mobile-dropdown-trigger");
await click(".assign");
assert.dom(".assign.d-modal").exists("assign modal opens");
});
});

acceptance("Discourse Assign | Assign desktop", function (needs) {
needs.user({
can_assign: true,
});
needs.user({ can_assign: true });
needs.settings({ glimmer_post_menu_mode: "enabled", assign_enabled: true });

needs.pretender((server, helper) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ acceptance(
test("Footer dropdown contains button", async function (assert) {
updateCurrentUser({ can_assign: true });
await visit("/t/internationalization-localization/280");
const menu = selectKit(".topic-footer-mobile-dropdown");
await menu.expand();

assert.true(menu.rowByValue("assign").exists());
await menu.selectRowByValue("assign");
await click(".topic-footer-mobile-dropdown-trigger");
await click(".assign");
assert.dom(".assign.d-modal").exists("assign modal opens");
});
}
Expand Down
11 changes: 5 additions & 6 deletions test/javascripts/acceptance/assigned-topic-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { visit } from "@ember/test-helpers";
import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import topicFixtures from "discourse/tests/fixtures/topic";
import {
Expand Down Expand Up @@ -220,14 +220,13 @@ acceptance("Discourse Assign | Reassign topic | mobile", function (needs) {

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

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

assert.true(menu.rowByValue("unassign-mobile").exists());
assert.true(menu.rowByValue("reassign-mobile").exists());
assert.true(menu.rowByValue("reassign-self-mobile").exists());
assert.dom("#topic-footer-button-unassign-mobile").exists();
assert.dom("#topic-footer-button-reassign-self-mobile").exists();
assert.dom("#topic-footer-button-reassign-mobile").exists();
});
});

Expand Down
Loading