2019-06-06 04:47:10 -04:00
|
|
|
import selectKit from "helpers/select-kit-helper";
|
2017-04-12 02:54:03 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
2019-06-06 04:47:10 -04:00
|
|
|
|
2017-04-12 02:54:03 -04:00
|
|
|
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 => {
|
2017-12-22 07:08:12 -05: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-29 16:51:32 -04:00
|
|
|
await notificationOptions.expand();
|
|
|
|
await notificationOptions.selectRowByValue("3");
|
2017-04-12 02:54:03 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
assert.equal(
|
2020-02-03 08:22:14 -05:00
|
|
|
notificationOptions.header().label(),
|
2018-07-26 06:16:32 -04:00
|
|
|
"Watching",
|
|
|
|
"it should display the right notification level"
|
|
|
|
);
|
2017-09-06 10:58:00 -04:00
|
|
|
});
|