@@ -6,7 +6,7 @@ import { Deferred } from 'core/utils/deferred';
66import keyboardMock from '../../helpers/keyboardMock.js' ;
77import { createBlobFile } from '../../helpers/fileHelper.js' ;
88import { getFileChunkCount } from '../../helpers/fileManagerHelpers.js' ;
9- import { shouldSkipOnMobile } from '../../helpers/device.js' ;
9+ import { shouldSkipOnDesktop , shouldSkipOnMobile } from '../../helpers/device.js' ;
1010import '../../helpers/xmlHttpRequestMock.js' ;
1111import 'generic_light.css!' ;
1212
@@ -269,7 +269,7 @@ QUnit.module('custom uploading', moduleConfig, () => {
269269 const chunkSize = 20000 ;
270270 const fileSize = 50100 ;
271271 const uploadChunkSpy = sinon . spy ( ( file , chunksInfo ) => {
272- lastCustomData = $ . extend ( true , { } , chunksInfo . customData ) ;
272+ lastCustomData = $ . extend ( true , { } , chunksInfo . customData ) ;
273273 chunksInfo . customData . testCounter = chunksInfo . customData . testCounter || 0 ;
274274 chunksInfo . customData . testCounter ++ ;
275275 return executeAfterDelay ( ) ;
@@ -287,7 +287,7 @@ QUnit.module('custom uploading', moduleConfig, () => {
287287
288288 this . clock . tick ( 500 ) ;
289289 assert . strictEqual ( uploadChunkSpy . callCount , 1 , 'custom function called for 1st chunk' ) ;
290- assert . deepEqual ( lastCustomData , { } , 'custom data is empty' ) ;
290+ assert . deepEqual ( lastCustomData , { } , 'custom data is empty' ) ;
291291
292292 this . clock . tick ( 1000 ) ;
293293 assert . strictEqual ( uploadChunkSpy . callCount , 2 , 'custom function called for 2nd chunk' ) ;
@@ -476,7 +476,7 @@ QUnit.module('custom uploading', moduleConfig, () => {
476476 return executeAfterDelay ( ) ;
477477 } ) ;
478478 const abortUploadSpy = sinon . spy ( ( file , chunksInfo ) => {
479- lastCustomData = $ . extend ( true , { } , chunksInfo . customData ) ;
479+ lastCustomData = $ . extend ( true , { } , chunksInfo . customData ) ;
480480 return executeAfterDelay ( ) ;
481481 } ) ;
482482
@@ -944,7 +944,7 @@ QUnit.module('uploading by chunks', moduleConfig, function() {
944944 let fileUploadedCount = 0 ;
945945 let totalBytes = 0 ;
946946 let totalLoadedBytes = 0 ;
947- const fileStates = { } ;
947+ const fileStates = { } ;
948948
949949 const files = [ createBlobFile ( 'fake1.png' , 100023 ) , createBlobFile ( 'fake2.png' , 5000 ) ] ;
950950 files . forEach ( function ( item ) {
@@ -3931,6 +3931,10 @@ QUnit.module('Drag and drop', moduleConfig, () => {
39313931 } ) ;
39323932
39333933 QUnit . test ( 'Default label text must be shown if upload mode is useForm and native drop is supported (T936087)' , function ( assert ) {
3934+ if ( shouldSkipOnMobile ( assert , 'default label text is hidden for mobile devices' ) ) {
3935+ return ;
3936+ }
3937+
39343938 const defaultLabelText = 'or Drop a file here' ;
39353939 const $fileUploader = $ ( '#fileuploader' ) . dxFileUploader ( {
39363940 uploadMode : 'useForm' ,
@@ -4061,11 +4065,14 @@ QUnit.module('disabled option', () => {
40614065 } ) ;
40624066
40634067 QUnit . test ( 'label text must be visible when disabled option changed dynamically' , function ( assert ) {
4068+ const defaultLabelText = 'or Drop a file here' ;
4069+
40644070 const $fileUploader = $ ( '#fileuploader' ) . dxFileUploader ( {
40654071 disabled : true ,
40664072 useDragOver : true ,
40674073 nativeDropSupported : true ,
4068- uploadMode : 'useForm'
4074+ uploadMode : 'useForm' ,
4075+ labelText : defaultLabelText ,
40694076 } ) ;
40704077 const $inputContainer = $fileUploader . find ( '.' + FILEUPLOADER_INPUT_CONTAINER_CLASS ) ;
40714078 const $inputLabel = $inputContainer . find ( '.' + FILEUPLOADER_INPUT_LABEL_CLASS ) ;
@@ -4075,7 +4082,7 @@ QUnit.module('disabled option', () => {
40754082
40764083 $fileUploader . dxFileUploader ( 'option' , 'disabled' , false ) ;
40774084 assert . ok ( $inputContainer . is ( ':visible' ) , 'input container is visible' ) ;
4078- assert . strictEqual ( $inputLabel . text ( ) , 'or Drop a file here' , 'label has default text' ) ;
4085+ assert . strictEqual ( $inputLabel . text ( ) , defaultLabelText , 'label has default text' ) ;
40794086 } ) ;
40804087} ) ;
40814088
@@ -4086,7 +4093,8 @@ QUnit.module('readOnly option', moduleConfig, () => {
40864093 const $fileUploader = $ ( '#fileuploader' ) . dxFileUploader ( {
40874094 readOnly : false ,
40884095 useDragOver : true ,
4089- uploadMode : 'useButtons'
4096+ uploadMode : 'useButtons' ,
4097+ labelText : defaultLabelText
40904098 } ) ;
40914099 const $inputContainer = $fileUploader . find ( '.' + FILEUPLOADER_INPUT_CONTAINER_CLASS ) ;
40924100 const $inputLabel = $inputContainer . find ( '.' + FILEUPLOADER_INPUT_LABEL_CLASS ) ;
@@ -4335,3 +4343,16 @@ QUnit.module('integration of dx button components via dialogTrigger', moduleConf
43354343 } ) ;
43364344 } ) ;
43374345} ) ;
4346+
4347+ QUnit . module ( 'labelText' , moduleConfig , ( ) => {
4348+ QUnit . test ( 'Dropzone default label text should be hidden on mobile devices' , function ( assert ) {
4349+ if ( shouldSkipOnDesktop ( assert , 'should only apply on mobile devices' ) ) {
4350+ return ;
4351+ }
4352+
4353+ const $fileUploader = $ ( '#fileuploader' ) . dxFileUploader ( ) ;
4354+ const $inputLabel = $fileUploader . find ( `.${ FILEUPLOADER_INPUT_LABEL_CLASS } ` ) ;
4355+
4356+ assert . strictEqual ( $inputLabel . text ( ) , '' , 'default label is hidden on mobile' ) ;
4357+ } ) ;
4358+ } ) ;
0 commit comments