Skip to content

Commit d747028

Browse files
committedNov 29, 2018
update(cursor): voiceIdx -> voiceIdxInStaff
1 parent 02d5151 commit d747028

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ embed.getCursorPosition().then(function (position) {
456456
// position: {
457457
// "partIdx": 0,
458458
// "staffIdx": 1,
459-
// "voiceIdx": 0,
459+
// "voiceIdxInStaff": 0,
460460
// "measureIdx": 2,
461461
// "noteIdx": 1
462462
// }
@@ -478,7 +478,7 @@ embed.setCursorPosition({
478478
// position: {
479479
// "partIdx": 0,
480480
// "staffIdx": 1,
481-
// "voiceIdx": 0,
481+
// "voiceIdxInStaff": 0,
482482
// "measureIdx": 2,
483483
// "noteIdx": 1
484484
// }

‎test/integration/embed-integration.js

+15-5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ var APP_ID = '58fa312bea9bbd061b0ea8f3',
77
// PUBLIC_SCORE = '5bcc8e5b32023d903fb5fb26';
88

99
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+
1020
describe('Loading embed', () => {
1121
it('should instance an Embed using a container', (done) => {
1222
var container = document.createElement('div');
@@ -473,7 +483,7 @@ describe('Integration - Embed', () => {
473483
embed.getCursorPosition().then((position) => {
474484
assert.equal(position.partIdx, 0);
475485
assert.equal(position.staffIdx, 0);
476-
assert.equal(position.voiceIdx, 0);
486+
assert.equal(position.voiceIdxInStaff, 0);
477487
assert.equal(position.measureIdx, 0);
478488
assert.equal(position.noteIdx, 0);
479489
assert.ok(position.partUuid);
@@ -503,23 +513,23 @@ describe('Integration - Embed', () => {
503513
embed.setCursorPosition({
504514
partIdx: 0,
505515
staffIdx: 0,
506-
voiceIdx: 0,
516+
voiceIdxInStaff: 0,
507517
measureIdx: 2,
508518
noteIdx: 1,
509519
extra: 'skip'
510520
})
511521
.then((position) => {
512522
assert.equal(position.partIdx, 0);
513523
assert.equal(position.staffIdx, 0);
514-
assert.equal(position.voiceIdx, 0);
524+
assert.equal(position.voiceIdxInStaff, 0);
515525
assert.equal(position.measureIdx, 2);
516526
assert.equal(position.noteIdx, 1);
517527
return embed.getCursorPosition();
518528
})
519529
.then((position) => {
520530
assert.equal(position.partIdx, 0);
521531
assert.equal(position.staffIdx, 0);
522-
assert.equal(position.voiceIdx, 0);
532+
assert.equal(position.voiceIdxInStaff, 0);
523533
assert.equal(position.measureIdx, 2);
524534
assert.equal(position.noteIdx, 1);
525535
container.parentNode.removeChild(container);
@@ -570,7 +580,7 @@ describe('Integration - Embed', () => {
570580
staffIdx: 0,
571581
measureIdx: true,
572582
noteIdx: 0,
573-
voiceIdx: 0
583+
voiceIdxInStaff: 0
574584
})
575585
.catch((error) => {
576586
assert.equal(error.message, 'Parameter measureIdx should be a number, not boolean');

0 commit comments

Comments
 (0)
Please sign in to comment.