-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Extract File menu into a component #128
Conversation
Thank you, I definitely like this! A few tweaks:
|
@rwjblue Updated. Some of the actions could not be made into closure actions because they bubble to the route. |
this.set('activeFile', file); | ||
|
||
// Handle any actions with this.on('myAction', function(val) { ... }); | ||
this.on('addFile', (type) => { addFileCalled = true; fileType = type; }); |
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.
Can you tweak these to save to this
? Something like:
this.on('addFile', (type) => { this.addFileCalled = true; this.fileType = type; });
Then you can assert in the tests below like:
assert.ok(this.addFileCalled, 'addFile was called');
assert.equal(this.fileType, 'template', 'addFile was called with type parameter');
Using the above, will help us ensure that there is no leakage between tests. Say we add a test in the future that also triggers an action, the boolean xyzCalled
may have already been set causing the tests to be not quite right.
@rwjblue Updated again as per request. |
integration: true, | ||
beforeEach() { | ||
|
||
this.addFileCalled = false; |
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 totally fine as is, but removing these would result in the same test (since this.addFileCalled
would be undefined and not truthy the assertions would still pass).
👍 - Sorry to be such an annoying reviewer, but thanks for working so hard on this! |
Extract File menu into a component
Relevant to issue #127