Skip to content

Commit

Permalink
add an integration test of updating config via Mirador api
Browse files Browse the repository at this point in the history
  • Loading branch information
mejackreed committed Dec 12, 2018
1 parent 78dde5f commit 083a096
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* global miradorInstance */

describe('Config updating from instance', () => {
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/');
});
it('can modify the config via api', async () => {
await page.evaluate(() => {
const a = miradorInstance.actions.updateConfig({ foo: 'bat' });
miradorInstance.store.dispatch(a);
});
const config = await page.evaluate(() => (
miradorInstance.store.getState().config
));
await expect(config.foo).toBe('bat');
});
});
2 changes: 1 addition & 1 deletion minimal_redux_poc/__tests__/integration/mirador/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="mirador"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
Mirador({
var miradorInstance = Mirador({
id: 'mirador',
plugins: ['HelloWorld']
});
Expand Down
2 changes: 1 addition & 1 deletion minimal_redux_poc/src/config/settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default {
manifestVersion: 'v2',
foo: 'bar',
};

0 comments on commit 083a096

Please sign in to comment.