discourse/test/javascripts/integration/modal-test.js.es6

30 lines
748 B
Text
Raw Normal View History

integration("Modal");
test("modal", () => {
visit('/');
andThen(() => {
ok(find('#discourse-modal:visible').length === 0, 'there is no modal at first');
});
click('.login-button');
andThen(() => {
ok(find('#discourse-modal:visible').length === 1, 'modal should appear');
});
click('.modal-outer-container');
andThen(() => {
ok(find('#discourse-modal:visible').length === 0, 'modal should disappear when you click outside');
});
click('.login-button');
andThen(() => {
ok(find('#discourse-modal:visible').length === 1, 'modal should reappear');
});
keyEvent('#main-outlet', 'keyup', 27);
andThen(() => {
ok(find('#discourse-modal:visible').length === 0, 'ESC should close the modal');
});
});