Skip to content

Commit

Permalink
fix(var): finish topical
Browse files Browse the repository at this point in the history
see #43
  • Loading branch information
duncdrum committed Jan 25, 2024
1 parent 76c2c69 commit c5dfbd3
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 51 deletions.
37 changes: 37 additions & 0 deletions cypress/e2e/chronology.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,41 @@ describe('Chronology', () => {
})
})

describe('Sadeleer, Environmental principles. From political slogans to legal rules', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Sadeleer, Environmental principles. From political slogans to legal rules',
type: 'allFields'
}
})
})

// mix of reviews and different media types
// see #23
// old behaviour no longer reproducible,
// TOP1 is book (newest) followed by ebook 9same date) and earlier article with identical title
// 2020 book PPN 1740404548
// 2004 article PPN OLC1736991698
it('newer book shuold be before older article', () => {
cy.get('[href*="1740404548"]')
.parents('[id^="result"]')
.find('.record-number')
.invoke('text')
.then(($num1) => {
const num1 = parseInt($num1)

cy.get('[href*="OLC1736991698"]')
.parents('[id^="result"]')
.find('.record-number')
.invoke('text')
.then(($num2) => {
const num2 = parseInt($num2)
expect(num1).to.be.lessThan(num2)
})
})
})
})

})
20 changes: 20 additions & 0 deletions cypress/e2e/reviews.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,24 @@ describe('Review after reviewed', () => {
})
})

describe('Selam Berlin Yade Kara', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Selam Berlin Yade Kara',
type: 'allFields'
}
})
})
// this beginns to conflict with chronology requirement
// see #26
it.skip('TOP1 should be the novel (primary work)', () => {
cy.get('#result0')
.find('.save-record')
.invoke('attr', 'data-id')
.should('equal','364739789')
})
})

})
59 changes: 8 additions & 51 deletions cypress/e2e/topical.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ describe('Topical Search', () => {
})
})

it('should ...', () => {
cy.get('.resultlist')
it('should match "Aff. bipolare Psychose…"', () => {
cy.get('[href*="OLC2108288694"]')
.should('exist')
})
})

Expand All @@ -215,56 +216,12 @@ describe('Topical Search', () => {
})
})

it('should ...', () => {
cy.get('.resultlist')
})
})

describe('The Law of nature in the thought of Hugo grotius', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'The Law of nature in the thought of Hugo grotius',
type: 'allFields'
}
})
})

it('should ...', () => {
cy.get('.resultlist')
})
})

describe('Sadeleer, Environmental principles. From political slogans to legal rules', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Sadeleer, Environmental principles. From political slogans to legal rules',
type: 'allFields'
}
})
})

// too many articles?
it('should ...', () => {
cy.get('.resultlist')
// I don't understand the reasoning behind the requirement
it('should find at least one match', () => {
cy.get('[id*="result"]')
.should('have.length.gte', 1)
})
})

describe('Selam Berlin Yade Kara', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Selam Berlin Yade Kara',
type: 'allFields'
}
})
})
it('should ...', () => {
cy.get('.resultlist')
})
})

})

0 comments on commit c5dfbd3

Please sign in to comment.