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

test: remove workaround for fixed Menu.closePopup issue #37802

Merged
merged 1 commit into from Apr 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 3 additions & 12 deletions spec/api-menu-spec.ts
Expand Up @@ -816,13 +816,10 @@

it('should emit menu-will-close event', (done) => {
menu.on('menu-will-close', () => { done(); });
menu.popup({ window: w });
// https://github.com/electron/electron/issues/19411
setTimeout().then(() => {
menu.closePopup();
});
menu.closePopup();
});

Check failure on line 822 in spec/api-menu-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-menu-spec.ts#L819-L822

Patch Conflict
Raw output
++<<<<<<< HEAD
 +      // https://github.com/electron/electron/issues/19411
 +      setTimeout(() => {
 +        menu.closePopup();
 +      });
++=======
+       menu.closePopup();
++>>>>>>> test: remove workaround for fixed Menu.closePopup issue

Check failure on line 822 in spec/api-menu-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-menu-spec.ts#L819-L822

Patch Conflict
Raw output
++<<<<<<< HEAD
 +      // https://github.com/electron/electron/issues/19411
 +      setTimeout(() => {
 +        menu.closePopup();
 +      });
++=======
+       menu.closePopup();
++>>>>>>> test: remove workaround for fixed Menu.closePopup issue
it('returns immediately', () => {
const input = { window: w, x: 100, y: 101 };
const output = menu.popup(input) as unknown as {x: number, y: number, browserWindow: BrowserWindow};
Expand All @@ -849,22 +846,16 @@

expect(x).to.equal(100);
expect(y).to.equal(101);
// https://github.com/electron/electron/issues/19411
setTimeout().then(() => {
menu.closePopup();
});
menu.closePopup();
});

it('works with a given BrowserWindow, no options, and a callback', (done) => {
menu.popup({ window: w, callback: () => done() });
// https://github.com/electron/electron/issues/19411
setTimeout().then(() => {
menu.closePopup();
});
menu.closePopup();
});

it('prevents menu from getting garbage-collected when popuping', async () => {
const menu = Menu.buildFromTemplate([{ role: 'paste' }]);

Check failure on line 858 in spec/api-menu-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-menu-spec.ts#L855-L858

Patch Conflict
Raw output
++<<<<<<< HEAD
 +      // https://github.com/electron/electron/issues/19411
 +      setTimeout(() => {
 +        menu.closePopup();
 +      });
++=======
+       menu.closePopup();
++>>>>>>> test: remove workaround for fixed Menu.closePopup issue

Check failure on line 858 in spec/api-menu-spec.ts

View check run for this annotation

trop / Backportable? - 24-x-y

spec/api-menu-spec.ts#L855-L858

Patch Conflict
Raw output
++<<<<<<< HEAD
 +      // https://github.com/electron/electron/issues/19411
 +      setTimeout(() => {
 +        menu.closePopup();
 +      });
++=======
+       menu.closePopup();
++>>>>>>> test: remove workaround for fixed Menu.closePopup issue
menu.popup({ window: w });

// Keep a weak reference to the menu.
Expand Down