Skip to content

Commit

Permalink
Add test case for rename menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Larsen authored and Gaurav0 committed Feb 15, 2018
1 parent 141d9aa commit 943fab3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/templates/components/file-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</li>
{{#if activeEditorCol}}
<li><a {{action 'renameFile' activeFile}} class="test-rename-action">Rename {{activeFile.filePath}}</a></li>
<li><a {{action 'renameFile' activeFile}} class="test-rename-action">Move {{activeFile.filePath}}</a></li>
<li><a {{action 'renameFile' activeFile}} class="test-move-action">Move {{activeFile.filePath}}</a></li>
<li><a {{action 'removeFile' activeFile}} class="test-remove-action">Delete {{activeFile.filePath}}</a></li>
{{/if}}
{{#if session.isAuthenticated}}
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/components/file-menu-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ test("it calls renameFile on clicking 'Rename'", function(assert) {
assert.equal(this.renamedFile, this.file, 'renameFile was called with file to rename');
});

test("it calls renameFile on clicking 'Move'", function(assert) {
assert.expect(2);

this.$('.test-move-action').click();

assert.ok(this.renameFileCalled, 'renameFile was called');
assert.equal(this.renamedFile, this.file, 'renameFile was called with file to rename');
});

test("it calls removeFile on clicking 'Remove'", function(assert) {
assert.expect(2);

Expand Down

0 comments on commit 943fab3

Please sign in to comment.