2017-04-12 02:54:03 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Topic Notifications button", {
|
|
|
|
loggedIn: true,
|
2018-07-26 06:16:32 -04:00
|
|
|
pretend(server, helper) {
|
|
|
|
server.post("/t/280/notifications", () => {
|
|
|
|
return helper.response({});
|
2017-04-12 02:54:03 -04:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
QUnit.test("Updating topic notification level", async assert => {
|
2018-06-15 11:03:24 -04:00
|
|
|
const notificationOptions = selectKit(
|
|
|
|
"#topic-footer-buttons .topic-notifications-options"
|
|
|
|
);
|
2017-04-12 02:54:03 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
await visit("/t/internationalization-localization/280");
|
2017-04-12 02:54:03 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
assert.ok(
|
|
|
|
notificationOptions.exists(),
|
|
|
|
"it should display the notification options button in the topic's footer"
|
|
|
|
);
|
2017-04-12 02:54:03 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
await notificationOptions.expandAwait();
|
|
|
|
await notificationOptions.selectRowByValueAwait("3");
|
2017-04-12 02:54:03 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
assert.equal(
|
|
|
|
notificationOptions.selectedRow().name(),
|
|
|
|
"Watching",
|
|
|
|
"it should display the right notification level"
|
|
|
|
);
|
2017-09-06 10:58:00 -04:00
|
|
|
});
|