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

49 lines
1.3 KiB
Plaintext
Raw Normal View History

import { acceptance } from "helpers/qunit-helpers";
acceptance("Topic Notifications button", {
loggedIn: true,
2017-06-14 13:57:58 -04: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-14 13:57:58 -04:00
QUnit.test("Updating topic notification level", assert => {
visit("/t/internationalization-localization/280");
const notificationOptions = "#topic-footer-buttons .topic-notifications-options";
andThen(() => {
2017-06-14 13:57:58 -04:00
assert.ok(
2017-10-19 12:51:08 -07:00
exists(`${notificationOptions}`),
"it should display the notification options button in the topic's footer"
);
});
expandSelectKit(notificationOptions);
selectKitSelectRow("3", { selector: notificationOptions});
andThen(() => {
2017-10-19 12:51:08 -07:00
assert.equal(
selectKit(notificationOptions).selectedRow.name(),
2017-10-19 12:51:08 -07:00
"watching",
"it should display the right notification level"
);
2017-04-12 15:52:02 +08:00
// 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"),
2017-04-12 15:52:02 +08:00
// 'it should display the right notification level in topic timeline'
// );
});
});