mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 15:08:56 +08:00
39f3dbd945
* renames `select-box-kit` into `select-kit` * introduces `single-select` and `multi-select` as base components * introduces {{search-advanced-category-chooser}} as a better component for selecting category in advanced search * improves events handling in select-kit * recreates color selection inputs using {{multi-select}} and a custom {{selected-color}} component * replaces category-selector by a component using select-kit and based on multi-select * improves positioning of wrapper * removes the need for offscreen, and instead use `select-kit-header` as a base focus point for all select-kit based components * introduces a formal plugin api for select-kit based components * introduces a formal pattern for loading and updating select-kit based components: ``` computeValue() computeContent() mutateValue() ```
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import { acceptance } from "helpers/qunit-helpers";
|
|
acceptance("Topic Notifications button", {
|
|
loggedIn: true,
|
|
beforeEach() {
|
|
const response = object => {
|
|
return [
|
|
200,
|
|
{ "Content-Type": "application/json" },
|
|
object
|
|
];
|
|
};
|
|
|
|
server.post('/t/280/notifications', () => { // eslint-disable-line no-undef
|
|
return response({});
|
|
});
|
|
}
|
|
});
|
|
|
|
QUnit.test("Updating topic notification level", assert => {
|
|
visit("/t/internationalization-localization/280");
|
|
|
|
const notificationOptions = "#topic-footer-buttons .topic-notifications-options";
|
|
|
|
andThen(() => {
|
|
assert.ok(
|
|
exists(`${notificationOptions}`),
|
|
"it should display the notification options button in the topic's footer"
|
|
);
|
|
});
|
|
|
|
expandSelectKit(notificationOptions);
|
|
selectKitSelectRow("3", { selector: notificationOptions});
|
|
|
|
andThen(() => {
|
|
assert.equal(
|
|
selectKit(notificationOptions).selectedRow.name(),
|
|
"watching",
|
|
"it should display the right notification level"
|
|
);
|
|
|
|
// TODO: tgxworld I can't figure out why the topic timeline doesn't show when
|
|
// running the tests in phantomjs
|
|
// ok(
|
|
// exists(".timeline-footer-controls .notifications-button .watching"),
|
|
// 'it should display the right notification level in topic timeline'
|
|
// );
|
|
});
|
|
});
|