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 ecedae7
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 6 deletions.
60 changes: 57 additions & 3 deletions cypress/e2e/nested.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
describe('Parent Work', () => {
describe('Nested Work', () => {
// see #8
describe("African American Review", () => {
describe('African American Review', () => {
// 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,58 @@ 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
// PPN: 168000709
it('first hit should be parent work', () => {
cy.get('[href*="168000709"]')
.should('exist')
})
})

describe('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'
}
})
})


// PPN: 1755480725
it('first hit should be 2021 child work based on search term', () => {
cy.get('#result0')
.find('[href*="1755480725"]')
.should('exist')
})

// TODO(DP): failing is this desirable?
it('parent work should appear in initial results', () => {
cy.get('[href*="521689139"]')
.should('exist')
})

// This asssumes de default view
it('first hit should be child volume based on search term', () => {
cy.get('#result0')
.find('.media-type')
.should('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 ecedae7

Please sign in to comment.