forked from techlab/create-jquery-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
41 lines (32 loc) · 984 Bytes
/
test.js
File metadata and controls
41 lines (32 loc) · 984 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
describe('Plugin Default Init', function() {
var el, plugin;
beforeEach(function(){
jasmine.getFixtures().fixturesPath = 'base/test';
loadFixtures('test-template.html');
el = $('#test-element');
plugin = el.{{functionName}}();
});
afterEach(function(){
el.remove();
el = null;
});
it('should add default style to the element', function() {
expect(el).toHaveClass("my-style1");
});
});
describe('Plugin with Option Init', function() {
var el, plugin;
beforeEach(function(){
el = $('<div id="test-element"></div>');
$(document.body).append(el);
plugin = el.{{functionName}}({ myStyle: 'my-style2'});
});
afterEach(function(){
el.remove();
el = null;
});
it('should add specified style to the element', function() {
expect(el.hasClass('my-style2')).toBe(true);
expect(el).not.toHaveClass("my-style1");
});
});