test: convert a few more specs to async/await (#39712)

This commit is contained in:
Milan Burda 2023-09-04 12:33:29 +02:00 committed by GitHub
parent 54d8402a6c
commit f27b034045
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 70 additions and 89 deletions

View file

@ -813,15 +813,17 @@ describe('Menu module', function () {
}).to.not.throw();
});
it('should emit menu-will-show event', (done) => {
menu.on('menu-will-show', () => { done(); });
it('should emit menu-will-show event', async () => {
const menuWillShow = once(menu, 'menu-will-show');
menu.popup({ window: w });
await menuWillShow;
});
it('should emit menu-will-close event', (done) => {
menu.on('menu-will-close', () => { done(); });
it('should emit menu-will-close event', async () => {
const menuWillClose = once(menu, 'menu-will-close');
menu.popup({ window: w });
menu.closePopup();
await menuWillClose;
});
it('returns immediately', () => {