Sha256: a0fa8bd085e9c72234266512812ef6133e6a15fa71f0d152c03ac4d06c500cc6

Contents?: true

Size: 882 Bytes

Versions: 1

Compression:

Stored size: 882 Bytes

Contents

describe "Mercury.dialogHandlers.style", ->

  beforeEach ->
    fixture.load('mercury/dialogs/style.html')
    @dialog = {element: $(fixture.el)}
    Mercury.dialogHandlers.style.call(@dialog)

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

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


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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kiteditor-1.0.12 spec/javascripts/mercury/dialogs/style_spec.js.coffee