-
Notifications
You must be signed in to change notification settings - Fork 113
/
blaze-badge.spec.ts
53 lines (43 loc) · 1.13 KB
/
blaze-badge.spec.ts
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
47
48
49
50
51
52
53
import { TestWindow } from '@stencil/core/dist/testing';
import { Badge } from './blaze-badge';
describe('Badge', () => {
it('should build', () => {
expect(new Badge()).toBeTruthy();
});
let element;
const snapIt = (name, html) => {
it(name, async () => {
const window = new TestWindow();
element = await window.load({
components: [Badge],
html
});
window.flush();
expect(element).toMatchSnapshot();
});
};
snapIt(
'renders correctly with no props',
'<blaze-badge>default</blaze-badge>'
);
snapIt(
'appends the color modifier class',
'<blaze-badge type="brand">brand</blaze-badge>'
);
snapIt(
'handles boolean rounded attribute',
'<blaze-badge rounded>default</blaze-badge>'
);
snapIt(
'handles both boolean rounded attribute and type',
'<blaze-badge rounded type="brand">brand</blaze-badge>'
);
snapIt(
'handles boolean ghost and boolean rounded',
'<blaze-badge ghost rounded>default</blaze-badge>'
);
snapIt(
'supports all the modifiers',
'<blaze-badge ghost rounded type="brand">brand</blaze-badge>'
);
});