Skip to content
Snippets Groups Projects
Commit 903a1dfd authored by imranasghar96@hotmail.com's avatar imranasghar96@hotmail.com
Browse files

Add integration test for multi-seq dropdown

parent 24b1924d
No related branches found
No related tags found
No related merge requests found
/* global miradorInstance */
describe('Window Sidebar Sequence Dropdown', () => {
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-2/multipleSequences.json');
await expect(page).toClick('#fetchBtn');
await expect(page).toMatchElement('[data-manifestid="http://localhost:4488/__tests__/fixtures/version-2/multipleSequences.json"] button');
await expect(page).toClick('[data-manifestid="http://localhost:4488/__tests__/fixtures/version-2/multipleSequences.json"] button');
});
it('allows the user to switch the application', 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-2/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('#sequence-1');
await expect(page).toClick('#sequence-1');
await expect(page).toMatchElement('p', { text: 'fragm1a_1r' });
});
});
......@@ -137,7 +137,7 @@ export class WindowSideBarCanvasPanel extends Component {
classes={{ select: classes.select }}
className={classes.selectEmpty}
>
{ sequences.map((s, i) => <MenuItem value={s.id} key={s.id}><Typography variant="body2">{ WindowSideBarCanvasPanel.getUseableLabel(s, i) }</Typography></MenuItem>) }
{ sequences.map((s, i) => <MenuItem id={`sequence-${i}`} value={s.id} key={s.id}><Typography variant="body2">{ WindowSideBarCanvasPanel.getUseableLabel(s, i) }</Typography></MenuItem>) }
</Select>
</FormControl>
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment