diff options
author | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2015-02-13 17:49:46 -0200 |
---|---|---|
committer | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2015-02-19 16:41:24 -0200 |
commit | 63f74d2d9bcc85cff2fea92e80f49774bef5e6bf (patch) | |
tree | 1848295a91932db90afdbbc10bfd6b562059bf5f /web-ui/test/spec/tags/ui/tag_shortcut.spec.js | |
parent | 8e2143bce8c05d1e7ad6e9fbb4052b80ef49da9d (diff) |
#239 Remove deprecated code of tag shortcuts
Diffstat (limited to 'web-ui/test/spec/tags/ui/tag_shortcut.spec.js')
-rw-r--r-- | web-ui/test/spec/tags/ui/tag_shortcut.spec.js | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/web-ui/test/spec/tags/ui/tag_shortcut.spec.js b/web-ui/test/spec/tags/ui/tag_shortcut.spec.js deleted file mode 100644 index fe235541..00000000 --- a/web-ui/test/spec/tags/ui/tag_shortcut.spec.js +++ /dev/null @@ -1,57 +0,0 @@ -/* global jasmine */ -/* global Pixelated */ - -describeComponent('tags/ui/tag_shortcut', function () { - 'use strict'; - - var parent, shortcut, component, TagShortcut; - - beforeEach(function () { - TagShortcut = require('tags/ui/tag_shortcut'); - - component = jasmine.createSpyObj('tagComponent', ['triggerSelect']); - parent = $('<ul>'); - $('body').append(parent); - shortcut = TagShortcut.appendedTo(parent, { tag: { name: 'inbox', counts: { total: 15 }}, trigger: component }); - }); - - afterEach(function () { - $('body')[0].removeChild(parent[0]); - }); - - it('renders the shortcut inside the parent', function () { - expect(parent.html()).toMatch('<i class="fa fa-inbox"></i>'); - expect(parent.html()).toMatch('<div class="shortcut-label">inbox</div>'); - }); - - it('selects and unselect on tag.select', function () { - $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'inbox'}); - - expect(shortcut.$node).toHaveClass('selected'); - - $(document).trigger(Pixelated.events.ui.tag.select, { tag: 'sent'}); - - expect(shortcut.$node).not.toHaveClass('selected'); - }); - - it('delegates the click to linked tag', function (){ - shortcut.$node.click(); - - expect(component.triggerSelect).toHaveBeenCalled(); - }); - - it('teardown shortcuts on event but only if they are not in the DOM', function () { - parent.empty(); - var shortcutAddedAfterEmptyingParent = TagShortcut.appendedTo(parent, { tag: { name: 'inbox', counts: { total: 15 }}, trigger: component }); - // by now shorcut is not in the DOM anymore but shortcutAddedAfterEmptyingParent is - - spyOn(shortcut, 'teardown').and.callThrough(); - spyOn(shortcutAddedAfterEmptyingParent, 'teardown').and.callThrough(); - - $(document).trigger(Pixelated.events.tags.shortcuts.teardown); - - expect(shortcut.teardown).toHaveBeenCalled(); - expect(shortcutAddedAfterEmptyingParent.teardown).not.toHaveBeenCalled(); - }); -}); - |