Skip to content

Commit 603b839

Browse files
committed
feat: add Lumo and Material for password-field
1 parent 164ce9a commit 603b839

23 files changed

+211
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
2+
import { visualDiff } from '@web/test-runner-visual-regression';
3+
import '../../../theme/lumo/vaadin-password-field.js';
4+
import { PasswordField } from '../../../src/vaadin-password-field.js';
5+
6+
customElements.define('vaadin-password-field', PasswordField);
7+
8+
describe('password-field', () => {
9+
let div, element;
10+
11+
beforeEach(() => {
12+
div = document.createElement('div');
13+
div.style.display = 'inline-block';
14+
div.style.padding = '10px';
15+
element = fixtureSync('<vaadin-password-field></vaadin-password-field>', div);
16+
});
17+
18+
['ltr', 'rtl'].forEach((dir) => {
19+
describe(dir, () => {
20+
before(() => {
21+
document.documentElement.setAttribute('dir', dir);
22+
});
23+
24+
after(() => {
25+
document.documentElement.removeAttribute('dir');
26+
});
27+
28+
it('basic', async () => {
29+
await visualDiff(div, `${import.meta.url}_${dir}-basic`);
30+
});
31+
32+
it('value', async () => {
33+
element.value = 'value';
34+
await visualDiff(div, `${import.meta.url}_${dir}-value`);
35+
});
36+
37+
it('clear button', async () => {
38+
element.value = 'value';
39+
element.clearButtonVisible = true;
40+
await visualDiff(div, `${import.meta.url}_${dir}-clear-button`);
41+
});
42+
43+
it('reveal button hidden', async () => {
44+
element.value = 'value';
45+
element.revealButtonHidden = true;
46+
await visualDiff(div, `${import.meta.url}_${dir}-reveal-button-hidden`);
47+
});
48+
});
49+
});
50+
});
1.06 KB
Loading
1.63 KB
Loading
792 Bytes
Loading
1.4 KB
Loading
1.07 KB
Loading
1.63 KB
Loading
791 Bytes
Loading
1.42 KB
Loading
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
2+
import { visualDiff } from '@web/test-runner-visual-regression';
3+
import '../../../theme/material/vaadin-password-field.js';
4+
import { PasswordField } from '../../../src/vaadin-password-field.js';
5+
6+
customElements.define('vaadin-password-field', PasswordField);
7+
8+
describe('password-field', () => {
9+
let div, element;
10+
11+
beforeEach(() => {
12+
div = document.createElement('div');
13+
div.style.display = 'inline-block';
14+
div.style.padding = '10px';
15+
element = fixtureSync('<vaadin-password-field></vaadin-password-field>', div);
16+
});
17+
18+
['ltr', 'rtl'].forEach((dir) => {
19+
describe(dir, () => {
20+
before(() => {
21+
document.documentElement.setAttribute('dir', dir);
22+
});
23+
24+
after(() => {
25+
document.documentElement.removeAttribute('dir');
26+
});
27+
28+
it('basic', async () => {
29+
await visualDiff(div, `${import.meta.url}_${dir}-basic`);
30+
});
31+
32+
it('value', async () => {
33+
element.value = 'value';
34+
await visualDiff(div, `${import.meta.url}_${dir}-value`);
35+
});
36+
37+
it('clear button', async () => {
38+
element.value = 'value';
39+
element.clearButtonVisible = true;
40+
await visualDiff(div, `${import.meta.url}_${dir}-clear-button`);
41+
});
42+
43+
it('reveal button hidden', async () => {
44+
element.value = 'value';
45+
element.revealButtonHidden = true;
46+
await visualDiff(div, `${import.meta.url}_${dir}-reveal-button-hidden`);
47+
});
48+
});
49+
});
50+
});

0 commit comments

Comments
 (0)