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
Changes from 1 commit
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
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 @@

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();

Check failure on line 40 in test/javascripts/acceptance/self-approve-mobile-test.js

View workflow job for this annotation

GitHub Actions / ci / linting

Trailing spaces not allowed
});
});
Loading