Skip to content

Commit

Permalink
fix(duplicates): adjust for deduping
Browse files Browse the repository at this point in the history
Todessymbolik in Komoposi…
and …in der Musik no longer duplicates

close #95
  • Loading branch information
duncdrum committed Jul 15, 2024
1 parent d38c9ff commit ba7a35d
Showing 1 changed file with 92 additions and 53 deletions.
145 changes: 92 additions & 53 deletions cypress/e2e/duplicates.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,78 +125,117 @@ describe('duplicate entries', () => {
})
})

it('should show 2 items "Todessymbolik in Komoposi…"', () => {
cy.get('[href*="742413772"]')
.should('exist')
cy.get('[href*="097133701"]')
.should('exist')
})

it('should show both items in sequence', () => {

cy.get('[href*="742413772"]')
.parents('[id^="result"]')
.find('.record-number')
.invoke('text')
.then(($num1) => {
const num1 = parseInt($num1)

cy.get('[href*="097133701"]')
.parents('[id^="result"]')
.find('.record-number')
.invoke('text')
.then(($num2) => {
const num2 = parseInt($num2)
// see #95 no longer duplicate items
// it('should show 2 items "Todessymbolik in Komoposi…"', () => {
// cy.get('[href*="742413772"]')
// .should('exist')
// cy.get('[href*="097133701"]')
// .should('exist')
// })

// it('should show both items in sequence', () => {

// cy.get('[href*="742413772"]')
// .parents('[id^="result"]')
// .find('.record-number')
// .invoke('text')
// .then(($num1) => {
// const num1 = parseInt($num1)

// cy.get('[href*="097133701"]')
// .parents('[id^="result"]')
// .find('.record-number')
// .invoke('text')
// .then(($num2) => {
// const num2 = parseInt($num2)

// expect(num1 - num2).to.be.at.most(1)
// expect(num2 - num1).to.be.at.most(1)
// })
// })
// })

// it('should show 2 items "…in der Musik"', () => {
// cy.get('[href*="144358150X"]')
// .should('exist')
// cy.get('[href*="544614259"]')
// .should('exist')
// })

// it('should show both items in sequence', () => {

// cy.get('[href*="144358150X"]')
// .parents('[id^="result"]')
// .find('.record-number')
// .invoke('text')
// .then(($num1) => {
// const num1 = parseInt($num1)

// cy.get('[href*="544614259"]')
// .parents('[id^="result"]')
// .find('.record-number')
// .invoke('text')
// .then(($num2) => {
// const num2 = parseInt($num2)

// expect(num1).to.eq(num2 - 1)
// })
// })
// })
})

expect(num1 - num2).to.be.at.most(1)
expect(num2 - num1).to.be.at.most(1)
})
})
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: 'Title'
}
})
})

it('should show 2 items "…in der Musik"', () => {
cy.get('[href*="144358150X"]')
.should('exist')
cy.get('[href*="544614259"]')
.should('exist')
it('should find at least three matches', () => {
cy.get('[id*="result"]')
.should('have.length.gte', 3)
})
})

it('should show both items in sequence', () => {

cy.get('[href*="144358150X"]')
.parents('[id^="result"]')
.find('.record-number')
.invoke('text')
.then(($num1) => {
const num1 = parseInt($num1)

cy.get('[href*="544614259"]')
.parents('[id^="result"]')
.find('.record-number')
.invoke('text')
.then(($num2) => {
const num2 = parseInt($num2)
// see #95
// see above
describe('Todessymbolik in Komposi…', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'Todessymbolik in Kompositionen auf den Tod römisch-deutscher Könige und Kaiser',
type: 'Title'
}
})
})

expect(num1).to.eq(num2 - 1)
})
})
it('should find one match', () => {
cy.get('[id*="result"]')
.should('have.length', 1)
})
})

describe('The Law of nature in the thought of Hugo grotius', () => {
// see #95
// see above
describe('Todessymbolik in der Musik', () => {
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'The Law of nature in the thought of Hugo grotius',
lookfor: 'Todessymbolik in der Musik',
type: 'Title'
}
})
})

it('should find at three matches', () => {
it('should find one match', () => {
cy.get('[id*="result"]')
.should('have.length.gte', 3)
.should('have.length', 1)
})
})

Expand Down

0 comments on commit ba7a35d

Please sign in to comment.