@@ -363,6 +363,79 @@ describe('provider/bpmn - NameProps', function() {
363
363
364
364
} ) ;
365
365
366
+ describe ( 'integration' , function ( ) {
367
+
368
+ let clock ;
369
+
370
+ beforeEach ( bootstrapPropertiesPanel ( diagramXML , {
371
+ modules : testModules ,
372
+ debounceInput : 300
373
+ } ) ) ;
374
+
375
+ beforeEach ( function ( ) {
376
+ clock = sinon . useFakeTimers ( ) ;
377
+ } ) ;
378
+
379
+ afterEach ( function ( ) {
380
+ clock . restore ( ) ;
381
+ } ) ;
382
+
383
+ it ( 'should trim value be visible in XML' , inject ( async function ( elementRegistry , selection ) {
384
+
385
+ // given
386
+ const task1 = elementRegistry . get ( 'Task_1' ) ;
387
+
388
+ await act ( ( ) => {
389
+ selection . select ( task1 ) ;
390
+ } ) ;
391
+
392
+ // when
393
+ const idInput1 = domQuery ( 'textarea[name=name]' , container ) ;
394
+ changeInput ( idInput1 , 'foo ' ) ;
395
+ idInput1 . focus ( ) ;
396
+
397
+ await act ( ( ) => {
398
+ idInput1 . blur ( ) ;
399
+ } ) ;
400
+ clock . tick ( 2000 ) ;
401
+
402
+ // then
403
+ expect ( idInput1 . value ) . to . eql ( 'foo' ) ;
404
+ } ) ) ;
405
+
406
+
407
+ it ( 'should not propogate input to other element' , inject ( async function ( elementRegistry , selection ) {
408
+
409
+ // given
410
+ const task1 = elementRegistry . get ( 'Task_1' ) ;
411
+ const task2 = elementRegistry . get ( 'Task_2' ) ;
412
+
413
+ const originalValueTask2 = getBusinessObject ( task2 ) . get ( 'name' ) ;
414
+
415
+ await act ( ( ) => {
416
+ selection . select ( task1 ) ;
417
+ } ) ;
418
+
419
+ // when
420
+ const idInput1 = domQuery ( 'textarea[name=name]' , container ) ;
421
+ changeInput ( idInput1 , 'foo' ) ;
422
+ idInput1 . focus ( ) ;
423
+
424
+ await act ( ( ) => {
425
+ idInput1 . blur ( ) ;
426
+ selection . select ( task2 ) ;
427
+ } ) ;
428
+ const idInput2 = domQuery ( 'textarea[name=name]' , container ) ;
429
+ idInput2 . focus ( ) ;
430
+ clock . tick ( 2000 ) ;
431
+
432
+ // then
433
+ expect ( idInput2 . value ) . to . eql ( originalValueTask2 ) ;
434
+ expect ( idInput1 . value ) . to . not . eql ( idInput2 . value ) ;
435
+ } ) ) ;
436
+
437
+ } ) ;
438
+
366
439
} ) ;
367
440
368
441
0 commit comments