File tree Expand file tree Collapse file tree 3 files changed +33
-45
lines changed Expand file tree Collapse file tree 3 files changed +33
-45
lines changed Original file line number Diff line number Diff line change 1
1
import TestContainer from 'mocha-test-container-support' ;
2
2
3
3
import {
4
- act
4
+ act ,
5
+ waitFor
5
6
} from '@testing-library/preact' ;
6
7
7
8
import {
@@ -367,19 +368,14 @@ function getTaskHeaders(element) {
367
368
return getExtensionElementsList ( businessObject , 'zeebe:TaskHeaders' ) [ 0 ] ;
368
369
}
369
370
370
- async function expectEdited ( container , exists ) {
371
+ function expectEdited ( container , exists ) {
372
+ return waitFor ( ( ) => {
373
+ const indicator = domQuery ( `${ GROUP_SELECTOR } .bio-properties-panel-dot` , container ) ;
371
374
372
- await wait ( 50 ) ;
373
-
374
- const indicator = domQuery ( `${ GROUP_SELECTOR } .bio-properties-panel-dot` , container ) ;
375
-
376
- if ( exists ) {
377
- expect ( indicator ) . to . exist ;
378
- } else {
379
- expect ( indicator ) . not . to . exist ;
380
- }
375
+ if ( exists ) {
376
+ expect ( indicator ) . to . exist ;
377
+ } else {
378
+ expect ( indicator ) . not . to . exist ;
379
+ }
380
+ } ) ;
381
381
}
382
-
383
- function wait ( ms ) {
384
- return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
385
- }
Original file line number Diff line number Diff line change 1
1
import TestContainer from 'mocha-test-container-support' ;
2
2
3
3
import {
4
- act
4
+ act ,
5
+ waitFor
5
6
} from '@testing-library/preact' ;
6
7
7
8
import {
@@ -346,19 +347,14 @@ function getTaskHeaders(element) {
346
347
return getExtensionElementsList ( businessObject , 'zeebe:TaskHeaders' ) [ 0 ] ;
347
348
}
348
349
349
- async function expectEdited ( container , exists ) {
350
+ function expectEdited ( container , exists ) {
351
+ return waitFor ( ( ) => {
352
+ const indicator = domQuery ( `${ GROUP_SELECTOR } .bio-properties-panel-dot` , container ) ;
350
353
351
- await wait ( 50 ) ;
352
-
353
- const indicator = domQuery ( `${ GROUP_SELECTOR } .bio-properties-panel-dot` , container ) ;
354
-
355
- if ( exists ) {
356
- expect ( indicator ) . to . exist ;
357
- } else {
358
- expect ( indicator ) . not . to . exist ;
359
- }
354
+ if ( exists ) {
355
+ expect ( indicator ) . to . exist ;
356
+ } else {
357
+ expect ( indicator ) . not . to . exist ;
358
+ }
359
+ } ) ;
360
360
}
361
-
362
- function wait ( ms ) {
363
- return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
364
- }
Original file line number Diff line number Diff line change 1
1
import TestContainer from 'mocha-test-container-support' ;
2
2
3
3
import {
4
- act
4
+ act ,
5
+ waitFor
5
6
} from '@testing-library/preact' ;
6
7
7
8
import {
@@ -242,19 +243,14 @@ function getZeebeUserTask(element) {
242
243
}
243
244
244
245
245
- async function expectEdited ( container , exists ) {
246
+ function expectEdited ( container , exists ) {
247
+ return waitFor ( ( ) => {
248
+ const indicator = domQuery ( `${ GROUP_SELECTOR } .bio-properties-panel-dot` , container ) ;
246
249
247
- await wait ( 50 ) ;
248
-
249
- const indicator = domQuery ( `${ GROUP_SELECTOR } .bio-properties-panel-dot` , container ) ;
250
-
251
- if ( exists ) {
252
- expect ( indicator ) . to . exist ;
253
- } else {
254
- expect ( indicator ) . not . to . exist ;
255
- }
250
+ if ( exists ) {
251
+ expect ( indicator ) . to . exist ;
252
+ } else {
253
+ expect ( indicator ) . not . to . exist ;
254
+ }
255
+ } ) ;
256
256
}
257
-
258
- function wait ( ms ) {
259
- return new Promise ( resolve => setTimeout ( resolve , ms ) ) ;
260
- }
You can’t perform that action at this time.
0 commit comments