discourse-shared-edits/test/javascripts/acceptance/shared-edits-toggle-permission-test.js
Sam 4e51a4e231
Some checks failed
Discourse Plugin / ci (push) Has been cancelled
FEATURE: allow shared edits to be enabled on any group (#163)
Allow sites to choose which groups can enable or disable shared edits instead of hardcoding staff and TL4 users. Expose the permission on the current user serializer so the admin menu can hide toggle actions for unauthorized users.

Add rate limits to privileged reset and recover endpoints, and update specs, acceptance tests, docs, and settings copy for the new permission model.

* Update config/settings.yml

Co-authored-by: Martin Brennan <martin@discourse.org>

* fix spec

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2026-06-25 16:28:07 +10:00

18 lines
670 B
JavaScript

import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
acceptance("Discourse Shared Edits | Toggle permissions", function (needs) {
needs.user({ can_toggle_shared_edits: false });
needs.settings({ shared_edits_enabled: true });
test("hides the post admin toggle action", async function (assert) {
await visit("/t/internationalization-localization/280");
await click(".show-more-actions");
await click(".show-post-admin-menu");
assert
.dom(".admin-toggle-shared-edits")
.doesNotExist("the shared edits toggle action is hidden");
});
});