Files
Joffrey JAFFEUXandGitHub 9cc7b411d9 DEV: replaces topic-notifications-options by DMenu (#30298)
This commit introduces <NotificationsTracking /> which is a wrapper component around <DMenu /> which replaces the select-kit component <TopicNotificationsButton />.

Each tracking case has its dedicated component:

- topic -> `<TopicNotificationsTracking />`
- group -> `<GroupNotificationsTracking />`
- tag -> `<TagNotificationsTracking />`
- category -> `<CategoryNotificationsTracking />`
- chat thread -> `<ThreadNotificationsTracking />`
2024-12-16 19:59:18 +01:00

28 lines
792 B
JavaScript

import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import notificationsTracking from "discourse/tests/helpers/notifications-tracking-helper";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
acceptance("Topic Notifications button", function (needs) {
needs.user();
needs.pretender((server, helper) => {
server.post("/t/280/notifications", () => {
return helper.response({});
});
});
test("Updating topic notification level", async function (assert) {
await visit("/t/internationalization-localization/280");
await notificationsTracking().selectLevelId(3);
assert
.notificationsTracking()
.hasSelectedLevelName(
"watching",
"displays the right notification level"
);
});
});