discourse/test/javascripts/acceptance/topic-notifications-button-test.js.es6

41 lines
997 B
Plaintext
Raw Normal View History

import { acceptance } from "helpers/qunit-helpers";
acceptance("Topic Notifications button", {
loggedIn: true,
2017-06-15 01:57:58 +08:00
beforeEach() {
const response = object => {
return [
200,
{ "Content-Type": "application/json" },
object
];
};
server.post('/t/280/notifications', () => { // eslint-disable-line no-undef
return response({});
});
}
});
2017-06-15 01:57:58 +08:00
QUnit.test("Updating topic notification level", assert => {
const notificationOptions = selectKit("#topic-footer-buttons .topic-notifications-options");
visit("/t/internationalization-localization/280");
andThen(() => {
2017-06-15 01:57:58 +08:00
assert.ok(
notificationOptions.exists(),
"it should display the notification options button in the topic's footer"
);
});
notificationOptions.expand().selectRowByValue("3");
andThen(() => {
2017-10-20 03:51:08 +08:00
assert.equal(
notificationOptions.selectedRow().name(),
"Watching",
"it should display the right notification level"
);
});
});