Skip to content

Commit 23b880d

Browse files
test: add Aura visual tests for checkbox (#10779) (#10781)
Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
1 parent 9e1f6c3 commit 23b880d

21 files changed

+77
-0
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { fixtureSync } from '@vaadin/testing-helpers';
2+
import { visualDiff } from '@web/test-runner-visual-regression';
3+
import '../common.js';
4+
import '@vaadin/aura/aura.css';
5+
import '../../../vaadin-checkbox.js';
6+
7+
describe('checkbox', () => {
8+
let div, element;
9+
10+
beforeEach(() => {
11+
div = document.createElement('div');
12+
div.style.display = 'inline-block';
13+
div.style.padding = '10px';
14+
element = fixtureSync('<vaadin-checkbox label="Checkbox"></vaadin-checkbox>', div);
15+
});
16+
17+
describe('states', () => {
18+
it('basic', async () => {
19+
await visualDiff(div, 'basic');
20+
});
21+
22+
it('checked', async () => {
23+
element.checked = true;
24+
await visualDiff(div, 'checked');
25+
});
26+
27+
it('indeterminate', async () => {
28+
element.indeterminate = true;
29+
await visualDiff(div, 'indeterminate');
30+
});
31+
32+
it('checked', async () => {
33+
element.setAttribute('active', '');
34+
await visualDiff(div, 'active');
35+
});
36+
37+
describe('disabled', () => {
38+
beforeEach(() => {
39+
element.disabled = true;
40+
});
41+
42+
it('basic', async () => {
43+
await visualDiff(div, 'disabled');
44+
});
45+
46+
it('checked', async () => {
47+
element.checked = true;
48+
await visualDiff(div, 'disabled-checked');
49+
});
50+
51+
it('indeterminate', async () => {
52+
element.indeterminate = true;
53+
await visualDiff(div, 'disabled-indeterminate');
54+
});
55+
});
56+
57+
describe('readonly', () => {
58+
beforeEach(() => {
59+
element.readonly = true;
60+
});
61+
62+
it('basic', async () => {
63+
await visualDiff(div, 'readonly');
64+
});
65+
66+
it('checked', async () => {
67+
element.checked = true;
68+
await visualDiff(div, 'readonly-checked');
69+
});
70+
71+
it('indeterminate', async () => {
72+
element.indeterminate = true;
73+
await visualDiff(div, 'readonly-indeterminate');
74+
});
75+
});
76+
});
77+
});
2.93 KB
Loading
2.93 KB
Loading
3.11 KB
Loading
2.78 KB
Loading
2.67 KB
Loading
2.68 KB
Loading
2.99 KB
Loading
2.98 KB
Loading
2.88 KB
Loading

0 commit comments

Comments
 (0)