Skip to content

Commit

Permalink
fix: add more examples
Browse files Browse the repository at this point in the history
see #8 #12
  • Loading branch information
duncdrum committed Jan 8, 2024
1 parent 12a27c6 commit 7b9c2e9
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 4 deletions.
48 changes: 47 additions & 1 deletion cypress/e2e/nested.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Parent Work', () => {
// Title search and online access false to limit noise
// check if exact match first list item is the journal parent and subsequent entries are child works
// a more elaborate test would compare the value of '.record-number' within the same family
before(() => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
Expand All @@ -24,4 +24,50 @@ describe('Parent Work', () => {
.contains(' Band einer Zeitschrift/Zeitung ')
})
})

describe('Nachrichten Organ Bergbau Hüttenbetrieb', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Nachrichten Organ Bergbau Hüttenbetrieb',
type: 'allFields'
}
})
})

// (DP): 3 hits no child works as far as I can see
it('first hit should be parent work', () => {
cy.get('[href*="168000709"]')
.should('exist')
})
})

describe.only('Journal of Comparative Law 2021', () => {
// (DP): parent work not in top 20
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Journal of Comparative Law 2021',
type: 'allFields'
}
})
})

// TODO(DP): failing
it('first hit should be parent work', () => {
cy.get('#result0')
.find('[href*="521689139"]')
.should('exist')
})

// TODO(DP): failing
it('first hit should not be child volume', () => {
cy.get('#result0')
.find('.media-type')
.should('not.contain', 'Band einer Zeitschrift/Zeitung')
.and('not.contain', 'Serial Volume')
})
})
})
57 changes: 54 additions & 3 deletions cypress/e2e/reviews.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Review after reviewed', () => {
.should('exist')
})

// TODO(DP): unskip after yaml changes
// TODO(DP): failing
it.skip('first hit should not be a review', () => {
cy.get('#result0')
.contains('Strategeme')
Expand All @@ -46,13 +46,64 @@ describe('Review after reviewed', () => {
.should('exist')
})

// TODO(DP): unskip after yaml changes
it.skip('first hit should not be a review', () => {
// TODO(DP): failing
it('first hit should not be a review', () => {
cy.get('#result0')
.contains('Manik')
.should('not.contain', 'Rezension')
.should('not.contain', 'Book Reviews')
})
})

describe('Die Organisierte Welt Internationale Beziehungen und Organisationsforschung', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Die Organisierte Welt Internationale Beziehungen und Organisationsforschung',
type: 'AllFields'
}
})
})

// PPN 608988723
it('first hit matches Title', () => {
cy.get('#result0')
.find('[href*="608988723"]')
.should('exist')
})

it('second hit should be a review', () => {
cy.get('#result1')
.contains('Rezension')
})
})

describe('Young, Iris Marion (2002): Inclusion and Democracy. Oxford: Oxford University Press', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Young, Iris Marion (2002): Inclusion and Democracy. Oxford: Oxford University Press',
type: 'AllFields',
limit: '10'
}
})
})

// PPN 315776242
// TODO(DP): failing
it('first hit matches exact title', () => {
cy.get('#result0')
.find('[href*="315776242"]')
.should('exist')
})

it.only('second hit should be a review', () => {
cy.get('#result1')
.should('exist')
.contains('Review')
})
})

})

0 comments on commit 7b9c2e9

Please sign in to comment.