@@ -7,6 +7,16 @@ var APP_ID = '58fa312bea9bbd061b0ea8f3',
7
7
// PUBLIC_SCORE = '5bcc8e5b32023d903fb5fb26';
8
8
9
9
describe ( 'Integration - Embed' , ( ) => {
10
+ // On failure, clean dom
11
+ afterEach ( ( ) => {
12
+ try {
13
+ [ ...document . querySelectorAll ( 'div,iframe' ) ] . forEach ( el => document . body . removeChild ( el ) ) ;
14
+ }
15
+ catch ( err ) {
16
+ // console.debug(err);
17
+ }
18
+ } ) ;
19
+
10
20
describe ( 'Loading embed' , ( ) => {
11
21
it ( 'should instance an Embed using a container' , ( done ) => {
12
22
var container = document . createElement ( 'div' ) ;
@@ -473,7 +483,7 @@ describe('Integration - Embed', () => {
473
483
embed . getCursorPosition ( ) . then ( ( position ) => {
474
484
assert . equal ( position . partIdx , 0 ) ;
475
485
assert . equal ( position . staffIdx , 0 ) ;
476
- assert . equal ( position . voiceIdx , 0 ) ;
486
+ assert . equal ( position . voiceIdxInStaff , 0 ) ;
477
487
assert . equal ( position . measureIdx , 0 ) ;
478
488
assert . equal ( position . noteIdx , 0 ) ;
479
489
assert . ok ( position . partUuid ) ;
@@ -503,23 +513,23 @@ describe('Integration - Embed', () => {
503
513
embed . setCursorPosition ( {
504
514
partIdx : 0 ,
505
515
staffIdx : 0 ,
506
- voiceIdx : 0 ,
516
+ voiceIdxInStaff : 0 ,
507
517
measureIdx : 2 ,
508
518
noteIdx : 1 ,
509
519
extra : 'skip'
510
520
} )
511
521
. then ( ( position ) => {
512
522
assert . equal ( position . partIdx , 0 ) ;
513
523
assert . equal ( position . staffIdx , 0 ) ;
514
- assert . equal ( position . voiceIdx , 0 ) ;
524
+ assert . equal ( position . voiceIdxInStaff , 0 ) ;
515
525
assert . equal ( position . measureIdx , 2 ) ;
516
526
assert . equal ( position . noteIdx , 1 ) ;
517
527
return embed . getCursorPosition ( ) ;
518
528
} )
519
529
. then ( ( position ) => {
520
530
assert . equal ( position . partIdx , 0 ) ;
521
531
assert . equal ( position . staffIdx , 0 ) ;
522
- assert . equal ( position . voiceIdx , 0 ) ;
532
+ assert . equal ( position . voiceIdxInStaff , 0 ) ;
523
533
assert . equal ( position . measureIdx , 2 ) ;
524
534
assert . equal ( position . noteIdx , 1 ) ;
525
535
container . parentNode . removeChild ( container ) ;
@@ -570,7 +580,7 @@ describe('Integration - Embed', () => {
570
580
staffIdx : 0 ,
571
581
measureIdx : true ,
572
582
noteIdx : 0 ,
573
- voiceIdx : 0
583
+ voiceIdxInStaff : 0
574
584
} )
575
585
. catch ( ( error ) => {
576
586
assert . equal ( error . message , 'Parameter measureIdx should be a number, not boolean' ) ;
0 commit comments