diff --git a/cypress/e2e/author.cy.js b/cypress/e2e/author.cy.js index edb6c20..25ae32c 100644 --- a/cypress/e2e/author.cy.js +++ b/cypress/e2e/author.cy.js @@ -15,7 +15,7 @@ describe('Author Search', () => { it('first hit should be by the author', {tags: ['@next']}, () => { cy.get('#result0') .find('.resultlist-data') - .contains('Glaser, Karin') + .contains(/^(?=.*Karin)(?=.*Glaser)$/) }) }) @@ -97,7 +97,7 @@ describe('Author Search', () => { .find('[href*=Author]') .each(($el, index, $lis) => { cy.wrap($el) - .contains('Scheidt, Samuel') + .contains(/^(?=.*Samuel)(?=.*Scheidt)$/) }) .then(($lis) => { cy.wrap($lis) @@ -126,7 +126,7 @@ describe('Author Search', () => { .find('[href*=Author]') .each(($el, index, $lis) => { cy.wrap($el) - .contains('Schiller, Friedrich') + .contains(/^(?=.*Friedrich)(?=.*Schiller)$/) }) .then(($lis) => { cy.wrap($lis) @@ -159,4 +159,33 @@ describe('Author Search', () => { }) }) }) -}) \ No newline at end of file +}) +describe('Elfriede Jelinek', () => { + beforeEach(() => { + cy.visit({ + url: '/Results', + qs: { + lookfor: 'Elfriede Jelinek', + type: 'Author' + + } + }) + }) + + + // Top 20 in author search should all be by author + // see #28 + it('Top 20 should all be by author', {tags: ['@next']}, () => { + cy.get('.resultlist-data') + .find('[href*=Author]') + .each(($el, index, $lis) => { + cy.wrap($el) + .contains(/^(?=.*Elfriede)(?=.*Jelinek)$/) + }) + .then(($lis) => { + cy.wrap($lis) + .should('have.length', '20') + }) + + }) + }) \ No newline at end of file