Sha256: 24058cb1c3e052ea783a3df9a755c77d62753ae825c4448b6effd0092f534e83

Contents?: true

Size: 895 Bytes

Versions: 31

Compression:

Stored size: 895 Bytes

Contents

describe "Mercury.dialogHandlers.formatblock", ->

  template 'mercury/dialogs/formatblock.html'

  beforeEach ->
    @dialog = {element: $('#test')}
    Mercury.dialogHandlers.formatblock.call(@dialog)

  describe "when an element with a data-tag attribute is clicked", ->

    it "triggers an action", ->
      spy = spyOn(Mercury, 'trigger').andCallFake(=>)
      jasmine.simulate.click($('#h1').get(0))
      expect(spy.callCount).toEqual(1)
      expect(spy.argsForCall[0]).toEqual(['action', {action: 'formatblock', value: 'h1'}])
      jasmine.simulate.click($('#div').get(0))
      expect(spy.argsForCall[1]).toEqual(['action', {action: 'formatblock', value: 'pre'}])


  describe "when any other element is clicked", ->

    it "does nothing", ->
      spy = spyOn(Mercury, 'trigger').andCallFake(=>)
      jasmine.simulate.click($('#em').get(0))
      expect(spy.callCount).toEqual(0)

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
kiteditor-1.0.25 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.24 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.23 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.22 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.21 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.20 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.19 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.18 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.17 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.16 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.14 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.13 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.11 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.10 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.9 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.8 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.7 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.6 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.5 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee
kiteditor-1.0.4 spec/javascripts/mercury/dialogs/formatblock_spec.js.coffee