mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
da9e2792eb
It wasn't tearing itself down properly. It was swallowing events.
29 lines
750 B
JavaScript
29 lines
750 B
JavaScript
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', 'keydown', 27);
|
|
andThen(() => {
|
|
ok(find('#discourse-modal:visible').length === 0, 'ESC should close the modal');
|
|
});
|
|
});
|