tify
Version:
A slim and mobile-friendly IIIF document viewer
62 lines (43 loc) • 1.73 kB
JavaScript
describe('Views', () => {
it('changes the view via buttons', () => {
const encodedParams = encodeURIComponent(JSON.stringify({
childManifestUrl: `${Cypress.env('iiifApiUrl')}/manifest/wellcome-b19974760_1_0004`,
}));
cy.visit(`/?manifest=${Cypress.env('iiifApiUrl')}/manifest/wellcome-b19974760&tify=${encodedParams}`);
cy.contains('Fulltext').click();
cy.get('.-active').contains('Fulltext');
cy.contains('Pages').click();
cy.get('.-active').contains('Pages');
cy.contains('Contents').click();
cy.get('.-active').contains('Contents');
cy.contains('Info').click();
cy.get('.-active').contains('Info');
cy.contains('Export').click();
cy.get('.-active').contains('Export');
cy.contains('Collection').click();
cy.get('.-active').contains('Collection');
cy.contains('Help').click();
cy.get('.-active').contains('Help');
});
it('changes the view via keyboard', () => {
const encodedParams = encodeURIComponent(JSON.stringify({
childManifestUrl: `${Cypress.env('iiifApiUrl')}/manifest/wellcome-b19974760_1_0004`,
}));
cy.visit(`/?manifest=${Cypress.env('iiifApiUrl')}/manifest/wellcome-b19974760&tify=${encodedParams}`);
cy.contains('The chemist and druggist');
cy.get('.tify').type('1');
cy.get('.-active').contains('Fulltext');
cy.get('.tify').type('2');
cy.get('.-active').contains('Pages');
cy.get('.tify').type('3');
cy.get('.-active').contains('Contents');
cy.get('.tify').type('4');
cy.get('.-active').contains('Info');
cy.get('.tify').type('5');
cy.get('.-active').contains('Export');
cy.get('.tify').type('6');
cy.get('.-active').contains('Collection');
cy.get('.tify').type('7');
cy.get('.-active').contains('Help');
});
});