Skip to content

Commit 239c822

Browse files
authored
test: update CRUD tests to use desktop breakpoint by default (#6244)
1 parent 0a42994 commit 239c822

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

‎packages/crud/test/crud-buttons.test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect } from '@esm-bundle/chai';
22
import { aTimeout, change, fire, fixtureSync, listenOnce, nextRender, oneEvent } from '@vaadin/testing-helpers';
3+
import { setViewport } from '@web/test-runner-commands';
34
import sinon from 'sinon';
45
import '../src/vaadin-crud.js';
56
import { flushGrid } from './helpers.js';
@@ -11,6 +12,10 @@ describe('crud buttons', () => {
1112
fire(crud._grid, 'edit', { item });
1213
}
1314

15+
before(async () => {
16+
await setViewport({ width: 1024, height: 768 });
17+
});
18+
1419
['default', 'slotted'].forEach((mode) => {
1520
const isDefault = mode === 'default';
1621

‎packages/crud/test/crud-editor.test.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { expect } from '@esm-bundle/chai';
22
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
3+
import { setViewport } from '@web/test-runner-commands';
34
import '../vaadin-crud.js';
45
import { flushGrid } from './helpers.js';
56

67
describe('crud editor', () => {
78
let crud;
89

10+
before(async () => {
11+
await setViewport({ width: 1024, height: 768 });
12+
});
13+
914
describe('header', () => {
1015
let header;
1116

@@ -51,7 +56,6 @@ describe('crud editor', () => {
5156
`);
5257
}
5358
crud.editOnClick = true;
54-
crud._fullscreen = false;
5559
await nextRender(crud);
5660
flushGrid(crud._grid);
5761

‎packages/crud/test/crud.test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect } from '@esm-bundle/chai';
22
import { aTimeout, change, fire, fixtureSync, listenOnce, nextRender, oneEvent } from '@vaadin/testing-helpers';
3+
import { setViewport } from '@web/test-runner-commands';
34
import sinon from 'sinon';
45
import '../src/vaadin-crud.js';
56
import { capitalize, getProperty, setProperty } from '../src/vaadin-crud-helpers.js';
@@ -12,6 +13,10 @@ describe('crud', () => {
1213
fire(crud._grid, 'edit', { item });
1314
}
1415

16+
before(async () => {
17+
await setViewport({ width: 1024, height: 768 });
18+
});
19+
1520
describe('custom element definition', () => {
1621
let tagName;
1722

‎packages/crud/test/dom/__snapshots__/crud.test.snap.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
export const snapshots = {};
33

44
snapshots["vaadin-crud host default"] =
5-
`<vaadin-crud
6-
editor-position=""
7-
fullscreen=""
8-
>
5+
`<vaadin-crud editor-position="">
96
<h3 slot="header">
107
Edit item
118
</h3>

‎packages/crud/test/dom/crud.test.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { expect } from '@esm-bundle/chai';
22
import { fixtureSync, nextRender } from '@vaadin/testing-helpers';
3+
import { setViewport } from '@web/test-runner-commands';
34
import '../../vaadin-crud.js';
45
import { resetUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
56

67
describe('vaadin-crud', () => {
78
let crud;
89

10+
before(async () => {
11+
await setViewport({ width: 1024, height: 768 });
12+
});
13+
914
beforeEach(async () => {
1015
resetUniqueId();
1116
crud = fixtureSync('<vaadin-crud></vaadin-crud>');

0 commit comments

Comments
 (0)