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 #229

Merged
merged 3 commits 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
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
< 3.4.0.beta3-dev: 203b047e5bfdcb038fafa97cf03c00fa2d89ec05
< 3.4.0.beta2-dev: a6faed4b36a2519c56792cea967d0629db3194fc
< 3.4.0.beta1-dev: a36e36e38619f1b239c1c5d891469e8b089459e4
< 3.3.0.beta1-dev: de63793ad493f30904f1e45ea38daa027bb4e3f5
Expand Down
19 changes: 6 additions & 13 deletions test/javascripts/acceptance/self-approve-mobile-test.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
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 {
acceptance,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";

acceptance("review mobile", function (needs) {
needs.user({
can_review_code: true,
});
needs.user({ can_review_code: true });
needs.mobileView();
needs.settings({
code_review_approved_tag: "approved",
Expand All @@ -29,21 +26,17 @@ acceptance("review mobile", function (needs) {

test("shows approve button by default", async (assert) => {
await visit("/t/internationalization-localization/281");
await click(".topic-footer-mobile-dropdown-trigger");

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

assert.ok(menu.rowByValue("approve").exists());
assert.dom(".approve").exists();
});

test("hides approve button if user is self", async (assert) => {
updateCurrentUser({ id: 1 });

await visit("/t/this-is-a-test-topic/9/1");
await click(".topic-footer-mobile-dropdown-trigger");

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

assert.notOk(menu.rowByValue("approve").exists());
assert.dom(".approve").doesNotExist();
});
});
Loading