Skip to content

test: update app-layout visual tests to use fixed height #8385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/app-layout/test/visual/fixed-height-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

registerStyles(
'vaadin-app-layout',
css`
:host,
:host([overlay]) [part='backdrop'],
[part='drawer'] {
height: inherit;
}
`,
);
3 changes: 2 additions & 1 deletion packages/app-layout/test/visual/lumo/app-layout.test.js
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 '../fixed-height-styles.js';
import '../../../theme/lumo/vaadin-app-layout.js';
import '../../../theme/lumo/vaadin-drawer-toggle.js';

Expand All @@ -8,7 +9,7 @@ describe('app-layout', () => {

beforeEach(() => {
div = document.createElement('div');
div.style.height = '100%';
div.style.height = '600px';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we achieve the same by explicitly setting the viewport size?

await setViewport({ width: 1024, height: 600 });

Copy link
Contributor

@vursen vursen Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or rather globally by specifying viewportSize here:

web-components/wtr-utils.js

Lines 270 to 275 in 3ee7650

{
name: `${theme[0].toUpperCase()}${theme.slice(1)} visual tests`,
build: `${process.env.GITHUB_REF || 'local'} build ${process.env.GITHUB_RUN_NUMBER || ''}`,
recordScreenshots: false,
recordVideo: false,
},

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, ideally we would use setViewport() but it needs to be implemented: modernweb-dev/web#1072
I'll look into that since it should be easy (especially when using concurrency: 1 and single session).


element = fixtureSync(
`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/app-layout/test/visual/material/app-layout.test.js
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 '../fixed-height-styles.js';
import '../../../theme/material/vaadin-app-layout.js';
import '../../../theme/material/vaadin-drawer-toggle.js';

Expand All @@ -8,7 +9,7 @@ describe('app-layout', () => {

beforeEach(() => {
div = document.createElement('div');
div.style.height = '100%';
div.style.height = '600px';

element = fixtureSync(
`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading