Skip to content

Commit 0543a0d

Browse files
committed
fix: fix test
1 parent be3f902 commit 0543a0d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

apps/demos/testing/widgets/fileuploader/CustomDropzone.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer';
2-
import { Selector as $, ClientFunction } from 'testcafe';
2+
import { Selector, ClientFunction } from 'testcafe';
33
import { runManualTest } from '../../../utils/visual-tests/matrix-test-helper';
44
import { testScreenshot } from '../../../utils/visual-tests/helpers/theme-utils';
55

@@ -14,12 +14,12 @@ fixture('FileUploader.CustomDropzone')
1414
runManualTest('FileUploader', 'CustomDropzone', (test) => {
1515
const triggerDragEnter = async (dropZoneSelector, items) => {
1616
await ClientFunction(() => {
17+
// @ts-expect-error $ is not typed
1718
const $dropZone = $(dropZoneSelector);
18-
// @ts-expect-error Selector.offset is not typed
1919
const { left, top } = $dropZone.offset();
20-
// @ts-expect-error Selector.trigger is not typed
20+
// @ts-expect-error $ is not typed
2121
$dropZone.trigger($.Event('dragenter', {
22-
// @ts-expect-error Selector.Event is not typed
22+
// @ts-expect-error $ is not typed
2323
originalEvent: $.Event('dragenter', {
2424
dataTransfer: {
2525
items,
@@ -35,13 +35,13 @@ runManualTest('FileUploader', 'CustomDropzone', (test) => {
3535
test('dropzone-active class is added to the dropzone element when single valid file is dragged over it', async (t) => {
3636
await triggerDragEnter(`#${DROPZONE_EXTERNAL_ID}`, [{ type: 'image/png' }]);
3737

38-
await t.expect($(`#${DROPZONE_EXTERNAL_ID}`).hasClass(DROPZONE_ACTIVE_CLASS)).ok();
38+
await t.expect(Selector(`#${DROPZONE_EXTERNAL_ID}`).hasClass(DROPZONE_ACTIVE_CLASS)).ok();
3939
});
4040

4141
test('dropzone-active class is not added to the dropzone element when an invalid file format is dragged', async (t) => {
4242
await triggerDragEnter(`#${DROPZONE_EXTERNAL_ID}`, [{ type: 'image/xlsx' }]);
4343

44-
await t.expect($(`#${DROPZONE_EXTERNAL_ID}`).hasClass(DROPZONE_ACTIVE_CLASS)).notOk();
44+
await t.expect(Selector(`#${DROPZONE_EXTERNAL_ID}`).hasClass(DROPZONE_ACTIVE_CLASS)).notOk();
4545
});
4646

4747
test('dropzone-active class is not added to the dropzone element when multiple items are dragged', async (t) => {
@@ -50,7 +50,7 @@ runManualTest('FileUploader', 'CustomDropzone', (test) => {
5050
{ type: 'image/png' },
5151
]);
5252

53-
await t.expect($(`#${DROPZONE_EXTERNAL_ID}`).hasClass(DROPZONE_ACTIVE_CLASS)).notOk();
53+
await t.expect(Selector(`#${DROPZONE_EXTERNAL_ID}`).hasClass(DROPZONE_ACTIVE_CLASS)).notOk();
5454
});
5555

5656
test('custom dropzone user interface appearance when dropzone-active is applied', async (t) => {

0 commit comments

Comments
 (0)