Skip to content

Commit 682436d

Browse files
committed
fix test
1 parent b45b9e1 commit 682436d

File tree

1 file changed

+12
-17
lines changed
  • e2e/testcafe-devextreme/tests/scheduler/common/keyboardNavigation

1 file changed

+12
-17
lines changed

e2e/testcafe-devextreme/tests/scheduler/common/keyboardNavigation/appointments.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { createWidget } from '../../../../helpers/createWidget';
66
fixture.disablePageReloads`KeyboardNavigation.Appointments`
77
.page(url(__dirname, '../../../container.html'));
88

9-
const PARENT_SELECTOR = '#parentContainer';
109
const SCHEDULER_SELECTOR = '#container';
1110

1211
test('Document should not scroll on \'End\' press when appointment is focused', async (t) => {
@@ -20,10 +19,9 @@ test('Document should not scroll on \'End\' press when appointment is focused',
2019

2120
await t.expect(scrollTop).eql(0);
2221
}).before(async () => {
23-
ClientFunction((selector) => {
24-
const parent = document.querySelector(selector) as HTMLElement;
25-
parent.style.height = '2000px';
26-
})(PARENT_SELECTOR);
22+
await ClientFunction(() => {
23+
document.body.style.height = '2000px';
24+
})();
2725

2826
await createWidget('dxScheduler', {
2927
dataSource: [
@@ -48,10 +46,9 @@ test('Document should not scroll on \'End\' press when appointment is focused',
4846
currentDate: new Date(2015, 1, 9),
4947
});
5048
}).after(async () => {
51-
ClientFunction((selector) => {
52-
const parent = document.querySelector(selector) as HTMLElement;
53-
parent.style.height = '';
54-
})(PARENT_SELECTOR);
49+
await ClientFunction(() => {
50+
document.body.style.height = '';
51+
})();
5552
});
5653

5754
test('Document should not scroll on \'Home\' press when appointment is focused', async (t) => {
@@ -67,10 +64,9 @@ test('Document should not scroll on \'Home\' press when appointment is focused',
6764

6865
await t.expect(scrollTop).eql(initialScrollTop);
6966
}).before(async () => {
70-
ClientFunction((selector) => {
71-
const parent = document.querySelector(selector) as HTMLElement;
72-
parent.style.height = '2000px';
73-
})(PARENT_SELECTOR);
67+
await ClientFunction(() => {
68+
document.body.style.height = '2000px';
69+
})();
7470

7571
await createWidget('dxScheduler', {
7672
dataSource: [
@@ -95,8 +91,7 @@ test('Document should not scroll on \'Home\' press when appointment is focused',
9591
currentDate: new Date(2015, 1, 9),
9692
});
9793
}).after(async () => {
98-
ClientFunction((selector) => {
99-
const parent = document.querySelector(selector) as HTMLElement;
100-
parent.style.height = '';
101-
})(PARENT_SELECTOR);
94+
await ClientFunction(() => {
95+
document.body.style.height = '';
96+
})();
10297
});

0 commit comments

Comments
 (0)