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

Render html menus in integration tests #749

Merged
merged 4 commits into from
May 6, 2020
Merged

Conversation

jameskerr
Copy link
Member

@jameskerr jameskerr commented May 5, 2020

We intercept the call to create the rightclick menu right before it gets sent to electron. Then we dispatch our own event to the dom, then build a simple html context menu that will only be used when process.env.BRIM_ITEST === "true".

D6eZyhUISQ

To test this locally, start the app normally, then open the console and type in the following:

image

Now the app will respond to right clicks by building an html version of the context menus.

@mikesbrown this should make those integration tests much easier to write.

@jameskerr jameskerr closed this May 5, 2020
@jameskerr jameskerr reopened this May 5, 2020
src/js/lib/System.js Outdated Show resolved Hide resolved
@jameskerr jameskerr requested review from mikesbrown and a team May 5, 2020 22:00
Copy link
Contributor

@mikesbrown mikesbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize it would be so easy to do this. This is awesome, thanks.

Copy link
Contributor

@mason-fish mason-fish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

jameskerr and others added 4 commits May 6, 2020 10:58
@jameskerr jameskerr merged commit 350d155 into master May 6, 2020
@jameskerr jameskerr deleted the right-click-experiment branch May 6, 2020 18:14
@philrz philrz linked an issue May 13, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleaner right-click tests and dealing with native menus
3 participants