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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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