-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get multi-sequences to work for v3 ranges/seqs
- Update sequences and canvases selectors to get multi-sequences to work for v3 top-level ranges with behavior sequence, check if full canvases exist in each sequence - Add integration test for v3 multi sequences
- Loading branch information
1 parent
8612748
commit 1314685
Showing
4 changed files
with
145 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"@context": [ | ||
"http://iiif.io/api/presentation/3/context.json" | ||
], | ||
"id": "http://foo.test/1/manifest", | ||
"type": "Manifest", | ||
"label": { | ||
"none": ["Version 3 manifest for multiple ranges (sequences behavior) related tests"] | ||
}, | ||
"items": [ | ||
{ | ||
"id": "http://foo.test/1/canvas/c1", | ||
"type": "Canvas", | ||
"label":{"none":["Test Canvas 1"]} | ||
}, | ||
{ | ||
"id": "http://foo.test/1/canvas/c2", | ||
"type": "Canvas", | ||
"label":{"none":["Test Canvas 2"]} | ||
}, | ||
{ | ||
"id": "http://foo.test/1/canvas/c3", | ||
"type": "Canvas", | ||
"label":{"none":["Test Canvas 3"]} | ||
} | ||
], | ||
"structures": [ | ||
{ | ||
"id": "http://foo.test/1/range/root", | ||
"type": "Range", | ||
"behavior": "sequence", | ||
"items": [ | ||
{ | ||
"id": "http://foo.test/1/canvas/c1", | ||
"type": "Canvas", | ||
"label":{"none":["Test Canvas 1"]} | ||
} | ||
] | ||
}, | ||
{ | ||
"id": "http://foo.test/1/range/second", | ||
"type": "Range", | ||
"behavior": "sequence", | ||
"items": [ | ||
{ | ||
"id": "http://foo.test/1/canvas/c2", | ||
"type": "Canvas", | ||
"label":{"none":["Test Canvas 2"]} | ||
}, | ||
{ | ||
"id": "http://foo.test/1/canvas/c3", | ||
"type": "Canvas", | ||
"label":{"none":["Test Canvas 3"]} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
34 changes: 34 additions & 0 deletions
34
__tests__/integration/mirador/sequence_switching_v3.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* global miradorInstance */ | ||
|
||
describe('Window Sidebar Sequence Dropdown v3', () => { | ||
beforeAll(async () => { | ||
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/blank.html'); | ||
|
||
await expect(page).toClick('#addBtn'); | ||
await expect(page).toClick('.mirador-add-resource-button'); | ||
await expect(page).toFill('#manifestURL', 'http://localhost:4488/__tests__/fixtures/version-3/multipleSequences.json'); | ||
await expect(page).toClick('#fetchBtn'); | ||
|
||
await expect(page).toMatchElement('[data-manifestid="http://localhost:4488/__tests__/fixtures/version-3/multipleSequences.json"] button'); | ||
await expect(page).toClick('[data-manifestid="http://localhost:4488/__tests__/fixtures/version-3/multipleSequences.json"] button'); | ||
}); | ||
|
||
it('allows the user to switch the v3 ranges (behavior sequences)', async () => { | ||
const windows = await page.evaluate(() => ( | ||
miradorInstance.store.getState().windows | ||
)); | ||
|
||
const windowId = Object.values(windows) | ||
.find(window => window.manifestId === 'http://localhost:4488/__tests__/fixtures/version-3/multipleSequences.json') | ||
.id; | ||
|
||
await expect(page).toMatchElement(`#${windowId} button[aria-label="Toggle sidebar"]`); | ||
await expect(page).toClick(`#${windowId} button[aria-label="Toggle sidebar"]`); | ||
await expect(page).toMatchElement(`#${windowId} button[aria-label="Index"]`); | ||
await expect(page).toClick(`#${windowId} button[aria-label="Index"]`); | ||
await expect(page).toClick('#mui-component-select-sequenceId'); | ||
await expect(page).toMatchElement('[data-value="http://foo.test/1/range/second"]'); | ||
await expect(page).toClick('[data-value="http://foo.test/1/range/second"]'); | ||
await expect(page).toMatchElement('p', { text: 'Test Canvas 2' }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters