Skip to content

Commit

Permalink
test: add test for getEmbedConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Coutelier authored and gierschv committed Jan 3, 2024
1 parent 3701b93 commit e7be13a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/integration/embed-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,38 @@ describe('Integration - Embed', () => {
});
});

describe('getEmbedConfig', () => {
it('with layout and other config elements', async () => {
// Given
const container = document.createElement('div');
document.body.appendChild(container);
const extraOpts = {
noHeader: true,
showTabRests: true,
layout: 'track',
hideTempo: true,
};

const embed = new Flat.Embed(container, {
baseUrl: BASE_URL,
score: QUARTET_SCORE,
embedParams: {
appId: APP_ID,
...extraOpts,
},
});

// When
const embedConfig = await embed.getEmbedConfig();

// Then
Object.entries(embedConfig).forEach(([key, expectedValue]) => {
const actualValue = embedConfig[key];
assert.deepStrictEqual(actualValue, expectedValue);
});
});
});

// describe('Editor config', () => {
// it('should fetch the viewer config', (done) => {
// var container = document.createElement('div');
Expand Down

0 comments on commit e7be13a

Please sign in to comment.