2014-09-08 16:52:49 -04:00
|
|
|
integration("Modal");
|
|
|
|
|
2015-03-19 07:22:56 -04:00
|
|
|
test("modal", () => {
|
2014-09-08 16:52:49 -04:00
|
|
|
visit('/');
|
|
|
|
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-09-08 16:52:49 -04:00
|
|
|
ok(find('#discourse-modal:visible').length === 0, 'there is no modal at first');
|
|
|
|
});
|
|
|
|
|
|
|
|
click('.login-button');
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-09-08 16:52:49 -04:00
|
|
|
ok(find('#discourse-modal:visible').length === 1, 'modal should appear');
|
|
|
|
});
|
|
|
|
|
|
|
|
click('.modal-outer-container');
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-09-08 16:52:49 -04:00
|
|
|
ok(find('#discourse-modal:visible').length === 0, 'modal should disappear when you click outside');
|
|
|
|
});
|
|
|
|
|
|
|
|
click('.login-button');
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2015-03-13 20:18:05 -04:00
|
|
|
ok(find('#discourse-modal:visible').length === 1, 'modal should reappear');
|
2014-09-08 16:52:49 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
keyEvent('#main-outlet', 'keyup', 27);
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-09-08 16:52:49 -04:00
|
|
|
ok(find('#discourse-modal:visible').length === 0, 'ESC should close the modal');
|
|
|
|
});
|
|
|
|
});
|