-
Notifications
You must be signed in to change notification settings - Fork 154
Conversation
} | ||
} | ||
); | ||
dialog.showMessageBox(dialogOptions, dialogCallback.bind(this)); |
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.
Nit: Maybe I'm inlining this in the render method as this got really short with the exports.
Codecov Report
@@ Coverage Diff @@
## master #348 +/- ##
==========================================
+ Coverage 24.91% 25.35% +0.44%
==========================================
Files 152 152
Lines 3625 3613 -12
Branches 388 388
==========================================
+ Hits 903 916 +13
+ Misses 2450 2426 -24
+ Partials 272 271 -1
|
Hey @AWolf81, long time no see 😃 I don't feel comfortable Approving this PR since I've been away from the project for a while, but it looks good to me 👍 My only feedback is that I always avoid |
@superhawk610 hey, no problem. I also always try to avoid I first tried to mock the |
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.
This is great 👍 Just one suggestion for clearer test description but it's not super important to be blocking.
wrapper = shallow(<EjectButton onClick={clickHandler} />); | ||
}); | ||
|
||
it('should render (not running)', () => { |
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.
At first glance it was a little unclear to me what running/not running meant, until I realized it was the pressed state... I think it could be changed to something like:
it('should render without being pressed (not running)', () => {
it('should render as pressed (running)', () => {
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.
Good catch. I modified it.
@@ -7,6 +7,7 @@ import { remote } from 'electron'; | |||
import { COLORS } from '../../constants'; | |||
|
|||
import BigClickableButton from '../BigClickableButton'; | |||
import type Electron from 'electron'; |
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.
I didn't realize they now include type definitions 👍
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.
Oh, OK, I've tested if the definition is working (by adding a key that's not in the definition - wasn't working) and noticed that this is a TypeScript definition and not Flow.
That's why I removed it.
So there is typing in Electron but no Flow types.
Do you think we should convert the other dialogs to this format without the |
@melanieseltzer yes, the test for that component will be similar to the If you like you can create a |
👍 I'll take a stab at converting the rest of the dialogs when I have some free time, I think it'll be good to have everything uniform. |
Related Issue:
#309
Summary:
Slightly modified
EjectButton
with two named exportsdialogOptions
anddialogCallback
so they can be used in the test.Tests: