diff --git a/minimal_redux_poc/.babelrc b/minimal_redux_poc/.babelrc index 4ffef06..2b7bafa 100644 --- a/minimal_redux_poc/.babelrc +++ b/minimal_redux_poc/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["env", "react"] + "presets": ["@babel/preset-env", "@babel/preset-react"] } diff --git a/minimal_redux_poc/.eslintignore b/minimal_redux_poc/.eslintignore index 8f8e2ae..446810d 100644 --- a/minimal_redux_poc/.eslintignore +++ b/minimal_redux_poc/.eslintignore @@ -1,2 +1,2 @@ -m3core.umd.js -mirador.min.js +dist/ +config/ diff --git a/minimal_redux_poc/.eslintrc b/minimal_redux_poc/.eslintrc index 10f6533..4e5af05 100644 --- a/minimal_redux_poc/.eslintrc +++ b/minimal_redux_poc/.eslintrc @@ -2,13 +2,15 @@ "env": { "jest/globals": true }, - "extends": "airbnb", + "extends": ["airbnb","react-app"], "globals": { "page": true, "document": true }, + "parser": "babel-eslint", "plugins": ["jest"], "rules": { + "no-console": "off", "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], "require-jsdoc": ["error", { "require": { @@ -16,7 +18,7 @@ "MethodDefinition": true, "ClassDeclaration": true, "ArrowFunctionExpression": true, - "FunctionExpression": true, + "FunctionExpression": true } }], "react/prefer-stateless-function": "off" diff --git a/minimal_redux_poc/.gitignore b/minimal_redux_poc/.gitignore index 766d3c6..924c1ed 100644 --- a/minimal_redux_poc/.gitignore +++ b/minimal_redux_poc/.gitignore @@ -1,3 +1,3 @@ -m3core.umd.js +dist/ -dist/mirador.min.js +.idea diff --git a/minimal_redux_poc/__tests__/integration/mirador/config_updating_from_instance.test.js b/minimal_redux_poc/__tests__/integration/mirador/config_updating_from_instance.test.js new file mode 100644 index 0000000..6190e90 --- /dev/null +++ b/minimal_redux_poc/__tests__/integration/mirador/config_updating_from_instance.test.js @@ -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'); + }); +}); diff --git a/minimal_redux_poc/__tests__/integration/mirador/index.html b/minimal_redux_poc/__tests__/integration/mirador/index.html index d79ce78..e820e5e 100644 --- a/minimal_redux_poc/__tests__/integration/mirador/index.html +++ b/minimal_redux_poc/__tests__/integration/mirador/index.html @@ -10,7 +10,7 @@