mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 11:13:44 +08:00
315b9d796d
* better test helper * more reliable tests * more consistent use of data-value/data-name/title/aria-label everywhere: header and rows
41 lines
997 B
JavaScript
41 lines
997 B
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 => {
|
|
const notificationOptions = selectKit("#topic-footer-buttons .topic-notifications-options");
|
|
|
|
visit("/t/internationalization-localization/280");
|
|
|
|
andThen(() => {
|
|
assert.ok(
|
|
notificationOptions.exists(),
|
|
"it should display the notification options button in the topic's footer"
|
|
);
|
|
});
|
|
|
|
notificationOptions.expand().selectRowByValue("3");
|
|
|
|
andThen(() => {
|
|
assert.equal(
|
|
notificationOptions.selectedRow().name(),
|
|
"Watching",
|
|
"it should display the right notification level"
|
|
);
|
|
});
|
|
});
|