Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngb-modal-dialog dismiss should dismiss on esc press by default case fails after #3384 #3415

Closed
peterblazejewicz opened this issue Oct 16, 2019 · 1 comment · Fixed by #3457
Milestone

Comments

@peterblazejewicz
Copy link
Contributor

Not sure if that is related to updated OS (Mac OS Catalina), but the case for ngb-modal-dialog ESC press started to fails in most recent version, probably due to some timing problems. The change was added with #3384

Thanks!

Bug description:

Run tests, e.g. yarn ngb:tdd
The case fails with timeout (test is asynchronous one):

TOTAL: 1 FAILED, 1276 SUCCESS
Chrome 79.0.3941 (Mac OS X 10.15.0) ngb-modal-dialog dismiss should dismiss on esc press by default FAILED
	Error: Timeout - Async callback was not invoked within 2000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)
	    at <Jasmine>

Link to minimally-working StackBlitz that reproduces the issue:

n/a

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 8.2.4

ng-bootstrap: 5.1.1

Bootstrap: n/a

OS: Mac OS 10.15/ Chrome 79.0.3941.4

@maxokorokov
Copy link
Member

I've seen it once on my machine as well (High Sierra), looks like it's a bit flaky :/
Anyway the idea was to test focus and keyboard support using e2e.

I'll have to cleanup unit tests, I think we have many use-cases covered.

Ex. closing on ESC

it('should close modal on ESC and re-focus trigger button', async() => {
await page.openModal('simple');
// close
await sendKey(Key.ESCAPE);
expect(await page.getModal().isPresent()).toBeFalsy('The modal should be closed on ESC');
// button should be focused
await expectFocused($('#open-modal-simple'), 'Should focus trigger button after closing');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants