From 48c80816055646249b3a8773e77f485e73c367cb Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 29 Jun 2020 09:24:45 -0700 Subject: [PATCH 1/2] Fix a container wiring issue --- src/containers/WindowTopBar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/WindowTopBar.js b/src/containers/WindowTopBar.js index eebf13ebba..82148be2f4 100644 --- a/src/containers/WindowTopBar.js +++ b/src/containers/WindowTopBar.js @@ -9,7 +9,7 @@ import { WindowTopBar } from '../components/WindowTopBar'; /** mapStateToProps */ const mapStateToProps = (state, { windowId }) => { - const config = getWindowConfig; + const config = getWindowConfig(state, { windowId }); return { allowClose: config.allowClose, From bbef7fad3750c16b0516214858122d95771006ce Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 29 Jun 2020 09:42:37 -0700 Subject: [PATCH 2/2] Add an integration test that configures mirador in a minimalist mode --- __tests__/integration/mirador/minimalist.html | 36 +++++++++++++++++++ .../integration/mirador/minimalist.test.js | 16 +++++++++ 2 files changed, 52 insertions(+) create mode 100644 __tests__/integration/mirador/minimalist.html create mode 100644 __tests__/integration/mirador/minimalist.test.js diff --git a/__tests__/integration/mirador/minimalist.html b/__tests__/integration/mirador/minimalist.html new file mode 100644 index 0000000000..7ecebbcf84 --- /dev/null +++ b/__tests__/integration/mirador/minimalist.html @@ -0,0 +1,36 @@ + + + + + + + Mirador + + + +
+ + + + diff --git a/__tests__/integration/mirador/minimalist.test.js b/__tests__/integration/mirador/minimalist.test.js new file mode 100644 index 0000000000..7357119448 --- /dev/null +++ b/__tests__/integration/mirador/minimalist.test.js @@ -0,0 +1,16 @@ +describe('Minimalist configuration to Mirador', () => { + beforeAll(async () => { + await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/minimalist.html'); + }); + it('loads a manifest and displays it without some of the default controls', async () => { + await expect(page).toMatchElement( + 'h2', + { text: /Self-Portrait/ }, + ); + await expect(page).toMatchElement('button[aria-label="Information"]'); + await expect(page).toMatchElement('button[aria-label="Rights"]'); + await expect(page).not.toMatchElement('#addBtn'); + await expect(page).not.toMatchElement('button[aria-label="Toggle sidebar"]'); + await expect(page).not.toMatchElement('button[aria-label="Close window"]'); + }); +});