Created
December 14, 2016 16:15
-
-
Save chalettu/06c981e32c0d8ad2a0ee9ff23701d27f to your computer and use it in GitHub Desktop.
Unit test for component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('detail-reveal component', function() { | |
beforeEach(function(){ | |
module('app.components', 'gettext'); | |
}); | |
describe('controller', function() { | |
var controller; | |
var $componentController; | |
var bindings = {title: 'Test', detail: 'test detail', icon: 'testIconClass', translateTitle: false, rowClass: 'test'}; | |
beforeEach(function(){ | |
inject(function(_$componentController_,$transclude) { | |
$componentController = _$componentController_; | |
transclude = $transclude.$new(); | |
ctrl = $componentController('detailReveal', {$transclude: transclude}, bindings); | |
} | |
) | |
} | |
); | |
it('is defined, accepts bindings', function() { | |
expect(ctrl).to.be.defined; | |
expect(ctrl.title).to.equal('Test'); | |
expect(ctrl.detail).to.equal('test detail'); | |
expect(ctrl.icon).to.equal('testIconClass'); | |
expect(ctrl.translateTitle).to.equal(false); | |
expect(ctrl.rowClass).to.equal('test'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment