-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtemba-label.test.ts
75 lines (65 loc) · 2.14 KB
/
temba-label.test.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { assert } from '@open-wc/testing';
import Label from '../src/label/Label';
import { assertScreenshot, getClip, getComponent } from './utils.test';
const TAG = 'temba-label';
const getLabel = async (slot, attrs: any = {}) => {
return (await getComponent(TAG, attrs, slot)) as Label;
};
describe('temba-label', () => {
it('renders default', async () => {
const label: Label = await getLabel('Default');
assert.instanceOf(label, Label);
await assertScreenshot('label/no-icon', getClip(label));
});
it('renders icon', async () => {
const label: Label = await getLabel('Default', { icon: 'check' });
await assertScreenshot('label/default-icon', getClip(label));
});
it('renders shadow', async () => {
const label: Label = await getLabel('Shadow', {
icon: 'check',
shadow: true
});
await assertScreenshot('label/shadow', getClip(label));
});
it('renders primary', async () => {
const label: Label = await getLabel('Primary', {
icon: 'check',
primary: true
});
await assertScreenshot('label/primary', getClip(label));
});
it('renders secondary', async () => {
const label: Label = await getLabel('Secondary', {
icon: 'check',
secondary: true
});
await assertScreenshot('label/secondary', getClip(label));
});
it('renders tertiary', async () => {
const label: Label = await getLabel('Tertiary', {
icon: 'check',
tertiary: true
});
await assertScreenshot('label/tertiary', getClip(label));
});
it('renders dark', async () => {
const label: Label = await getLabel('Dark', { icon: 'check', dark: true });
await assertScreenshot('label/dark', getClip(label));
});
it('renders danger', async () => {
const label: Label = await getLabel('Danger', {
icon: 'check',
danger: true
});
await assertScreenshot('label/danger', getClip(label));
});
it('renders custom', async () => {
const label: Label = await getLabel('Custom Orange', {
icon: 'check',
backgroundColor: 'rgb(240, 176, 29)',
textColor: '#ffff'
});
await assertScreenshot('label/custom', getClip(label));
});
});