Skip to content

Commit

Permalink
test: disable error-message transition in visual tests (#7830)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Sep 20, 2024
1 parent 8a8707c commit 1bf32d1
Show file tree
Hide file tree
Showing 23 changed files with 113 additions and 8 deletions.
11 changes: 11 additions & 0 deletions packages/checkbox-group/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-checkbox-group',
css`
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/lumo/vaadin-checkbox-group.js';

describe('checkbox-group', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/material/vaadin-checkbox-group.js';

describe('checkbox-group', () => {
Expand Down
11 changes: 11 additions & 0 deletions packages/checkbox/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-checkbox',
css`
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
1 change: 1 addition & 0 deletions packages/checkbox/test/visual/lumo/checkbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { fixtureSync } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/vaadin-lumo-styles/test/autoload.js';
import '../common.js';
import '../../../theme/lumo/vaadin-checkbox.js';

describe('checkbox', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/checkbox/test/visual/material/checkbox.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixtureSync } from '@vaadin/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/material/vaadin-checkbox.js';

describe('checkbox', () => {
Expand Down
7 changes: 6 additions & 1 deletion packages/combo-box/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-combo-box',
css`
/* Hide caret */
:host([focus-ring]) ::slotted(input),
:host([opened]) ::slotted(input) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);

Expand Down
11 changes: 11 additions & 0 deletions packages/custom-field/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-custom-field vaadin-date-picker vaadin-number-field vaadin-text-field',
css`
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '@vaadin/combo-box/theme/lumo/vaadin-combo-box.js';
import '@vaadin/date-picker/theme/lumo/vaadin-date-picker.js';
import '@vaadin/email-field/theme/lumo/vaadin-email-field.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '@vaadin/combo-box/theme/material/vaadin-combo-box.js';
import '@vaadin/date-picker/theme/material/vaadin-date-picker.js';
import '@vaadin/form-layout/theme/material/vaadin-form-item.js';
Expand Down
7 changes: 6 additions & 1 deletion packages/date-picker/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-date-picker',
css`
/* Hide caret */
:host([focus-ring]) ::slotted(input),
:host([opened]) ::slotted(input) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);

Expand Down
7 changes: 6 additions & 1 deletion packages/date-time-picker/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-date-picker',
css`
/* Hide caret */
:host([focused]) ::slotted(input) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
7 changes: 6 additions & 1 deletion packages/multi-select-combo-box/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-multi-select-combo-box',
css`
/* Hide caret */
:host([focused][focus-ring]) ::slotted(input),
:host([focused][has-value]) ::slotted(input),
:host([focused][opened]) ::slotted(input) {
caret-color: transparent !important;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
7 changes: 6 additions & 1 deletion packages/number-field/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-number-field',
css`
/* Hide caret */
:host([focus-ring]) ::slotted(input) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
11 changes: 11 additions & 0 deletions packages/radio-group/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-radio-group',
css`
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
1 change: 1 addition & 0 deletions packages/radio-group/test/visual/lumo/radio-group.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/lumo/vaadin-radio-group.js';

describe('radio-group', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixtureSync } from '@vaadin/testing-helpers/dist/fixture.js';
import { sendKeys } from '@web/test-runner-commands';
import { visualDiff } from '@web/test-runner-visual-regression';
import '../common.js';
import '../../../theme/material/vaadin-radio-group.js';

describe('radio-group', () => {
Expand Down
11 changes: 11 additions & 0 deletions packages/select/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-select',
css`
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
1 change: 1 addition & 0 deletions packages/select/test/visual/lumo/select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/item/theme/lumo/vaadin-item.js';
import '@vaadin/list-box/theme/lumo/vaadin-list-box.js';
import '../../not-animated-styles.js';
import '../common.js';
import '../../../theme/lumo/vaadin-select.js';

describe('select', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/select/test/visual/material/select.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { visualDiff } from '@web/test-runner-visual-regression';
import '@vaadin/item/theme/material/vaadin-item.js';
import '@vaadin/list-box/theme/material/vaadin-list-box.js';
import '../../not-animated-styles.js';
import '../common.js';
import '../../../theme/material/vaadin-select.js';

describe('select', () => {
Expand Down
7 changes: 6 additions & 1 deletion packages/text-area/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-text-area',
css`
/* Hide caret */
::slotted(textarea) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
7 changes: 6 additions & 1 deletion packages/text-field/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-text-field',
css`
/* Hide caret */
:host([focus-ring]) ::slotted(input) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);
7 changes: 6 additions & 1 deletion packages/time-picker/test/visual/common.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

/* Hide caret */
registerStyles(
'vaadin-time-picker',
css`
/* Hide caret */
:host([focus-ring]) ::slotted(input),
:host([opened]) ::slotted(input) {
caret-color: transparent;
}
/* Show error message immediately */
[part='error-message'] {
transition: none !important;
}
`,
);

0 comments on commit 1bf32d1

Please sign in to comment.