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
COMPASS-470 Add zoom in & out #741
Conversation
See the Venn Diagram here for whew straddle the two processes: https://medium.com/@ccnokes/deep-dive-into-electrons-main-and-renderer-processes-7a9599d5c9e2#.uh3qa3j8o
1. test/main-process/menu.zoom.test.js: Called by `npm run test-main`. This unit tests the menu items exist and have keyboard shortcut accelerators 2. test/renderer-process/zoom.test.js: Called by `npm run test-renderer` This unit tests that calling the zoom functions call the native electron.webFrame.get/setZoomLevel functions. Architecture based on: http://stackoverflow.com/questions/34485182/how-to-access-remote-module-from-unit-tests Also electron-mocha was already a devDependency, we just were not using it, so let’s bump the version and use it: https://github.com/jprichardson/electron-mocha
So “Zoom renderer tests” do not fail: Zoom renderer tests 3) should zoom reset 4) "after each" hook for "should zoom reset" … 3) Zoom renderer tests should zoom reset: TypeError: Cannot read property 'setZoomLevel' of undefined at zoomReset (src/app/menu-renderer.js:10:10) at Context.it (test/renderer-process/zoom.test.js:9:12) 4) Zoom renderer tests "after each" hook for "should zoom reset": TypeError: Cannot read property 'setZoomLevel' of undefined at zoomReset (src/app/menu-renderer.js:10:10) at Context.afterEach (test/renderer-process/zoom.test.js:6:5) Also hadron-build does not support the notion of separate testing processes, just a combined one, so we’ll want to revisit this later when we can agree what should go where.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice job!
@@ -61,7 +61,7 @@ | |||
"scripts": { | |||
"start": "hadron-build develop", | |||
"pretest": "mongodb-runner install && mongodb-runner start --port 27018", | |||
"test": "hadron-build test", | |||
"test": "npm run test-main && npm run test-renderer && hadron-build test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want these two options in hadron-build, but as a second PR after this PR.
I think hadron-build test
does everything, and you can specify --main
or --renderer
just like you can do --functional
.
expect(zoomIn()).to.be.equal(0.5); | ||
}); | ||
it('should zoom in at least 5x', () => { | ||
[1,2,3,4,5].forEach(() => {zoomIn()}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! :-)
@@ -175,7 +177,7 @@ | |||
"chai-enzyme": "^0.5.2", | |||
"devtron": "^1.4.0", | |||
"electron-devtools-installer": "^2.0.1", | |||
"electron-mocha": "^3.1.1", | |||
"electron-mocha": "^3.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this or just a bump while you're in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bump while I'm here as I had that one installed already. Doesn't look like too many changes: https://github.com/jprichardson/electron-mocha/blob/master/CHANGELOG.md
Fantastic! 🙌
…On Thu, Jan 12, 2017 at 6:06 AM Peter Schmidt ***@***.***> wrote:
Merged #741 <#741>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#741 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AR0ozaDZrqlbIUdCVLAZAOMBazro0R60ks5rRgkkgaJpZM4Lhc2H>
.
|
Really awesome!
…On 12 January 2017 at 08:03, Leafy ***@***.***> wrote:
Fantastic! 🙌
On Thu, Jan 12, 2017 at 6:06 AM Peter Schmidt ***@***.***>
wrote:
> Merged #741 <#741>.
>
>
>
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#741 (comment)>, or mute the
> thread
> <https://github.com/notifications/unsubscribe-auth/
AR0ozaDZrqlbIUdCVLAZAOMBazro0R60ks5rRgkkgaJpZM4Lhc2H>
> .
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#741 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA-E-2tTYVMOGYeNr307ZgyzU9BkPzGDks5rRiSegaJpZM4Lhc2H>
.
--
*{* name : "*Sam Weaver*",
title : "Product Manager",
phone : "+447549938422",
location : ["New York City, NY", "London, UK"],
twitter : ["@Samuel_Weaver <https://www.twitter.com/samuel_weaver>", "
@mongodb <https://www.twitter.com/mongodb>"],
facebook : "MongoDB <https://www.facebook.com/mongodb>" *}*
|
I know, right? It's a simple feature but I'm very pleased we finally got that in :)
…On 13 Jan 2017, 02:53 +1100, Sam Weaver ***@***.***>, wrote:
Really awesome!
On 12 January 2017 at 08:03, Leafy ***@***.***> wrote:
> Fantastic! 🙌
> On Thu, Jan 12, 2017 at 6:06 AM Peter Schmidt ***@***.***>
> wrote:
>
> > Merged #741 <#741>.
> >
> >
> >
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub
> > <#741 (comment)>, or mute the
> > thread
> > <https://github.com/notifications/unsubscribe-auth/
> AR0ozaDZrqlbIUdCVLAZAOMBazro0R60ks5rRgkkgaJpZM4Lhc2H>
> > .
>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#741 (comment)>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA-E-2tTYVMOGYeNr307ZgyzU9BkPzGDks5rRiSegaJpZM4Lhc2H>
> .
>
--
*{* name : "*Sam Weaver*",
title : "Product Manager",
phone : "+447549938422 (tel:+447549938422)",
location : ["New York City, NY", "London, UK"],
twitter : ***@***.***_Weaver <https://www.twitter.com/samuel_weaver>", "
@mongodb <https://www.twitter.com/mongodb>"],
facebook : "MongoDB <https://www.facebook.com/mongodb>" *}*
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#741 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAGDlfOF0xMhlZ-QqqiPFNNAgQmxIi04ks5rRkxygaJpZM4Lhc2H).
|
This also makes some changes to testing infrastructure, so happy to hear comments as I'm not sure how to push things back down towards https://github.com/mongodb-js/hadron-build.
If anyone has a 4K/5K or higher resolution monitor/projector/device to test it on that would also be nice, as we are not sure that it zooms in far enough on such a device (GIF recorded on a 2560x1440 27" Dell U2715H monitor).