kdf
Version:
33 lines (25 loc) • 858 B
text/coffeescript
{assert} = require 'chai'
sinon = require 'sinon'
KDButtonBar = require '../../../src/components/buttons/buttonbar.coffee'
describe 'KDButtonBar', ->
beforeEach ->
= sinon.sandbox.create()
afterEach ->
.restore()
describe 'constructor', ->
it 'should instantiate without error', ->
buttonBar = new KDButtonBar
assert.ok buttonBar
describe 'createButton', ->
beforeEach ->
= new KDButtonBar
it 'should create a new instance of the default button class', ->
spy = sinon.spy()
._itemClass = -> spy()
.createButton()
assert.ok spy.called
it 'should create a new instance of a passed button class', ->
stub = .stub()
buttonView = -> stub()
.createButton itemClass: buttonView
assert.ok stub.called