forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-button.js
More file actions
46 lines (33 loc) · 1007 Bytes
/
test-button.js
File metadata and controls
46 lines (33 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* MUI test angular button module
* @module test/angular-tests/test-button
*/
import assert from 'assert';
let helpers = require('./angular-helper'),
ngModule = helpers.module,
inject = helpers.inject,
jqLite = helpers.jqLite;
require('../../src/angular/button.js');
describe('angular/button', function() {
let compile, scope;
beforeEach(function() {
ngModule('mui.button');
inject(function($compile, $rootScope) {
compile = $compile;
scope = $rootScope.$new();
});
});
afterEach(function() {
scope.$destroy();
});
it('renders properly', function() {
let buttonEl = compile('<mui-button>test</mui-button>')(scope)[0];
assert.equal(buttonEl.tagName, 'BUTTON');
assert.equal(jqLite.hasClass(buttonEl, 'mui-btn'), true);
});
it('renders type attribute', function() {
let s = '<mui-button type="button">test</mui-button>';
let element = compile(s)(scope);
assert.equal(element.attr('type'), 'button');
});
});