Skip to content

Commit

Permalink
fix(chronology): future publication
Browse files Browse the repository at this point in the history
add future date query

close #58
  • Loading branch information
duncdrum committed Feb 12, 2024
1 parent 2f9ce9f commit 2399590
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions cypress/e2e/chronology.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
describe('Chronology', () => {
// see #11

describe('Andreas Gryphius', () => {
// DP: add sort: 'year' to qs for sorted results
beforeEach(() => {
Expand Down Expand Up @@ -118,8 +119,8 @@ describe('Chronology', () => {
}
})
})


it.skip('should show relevant literature according to chronology', () => {
cy.get('.resultlist')
})
Expand All @@ -129,7 +130,7 @@ describe('Chronology', () => {
// 608 hits total but many do not contain the search terms in the title
// or are about later periods all together
// why is 130141674 shown ?
// definition of relevance?
// definition of relevance?
// see #39
describe('Kulturgeschichte deutsches Kaiserreich', () => {
beforeEach(() => {
Expand Down Expand Up @@ -181,14 +182,14 @@ describe('Chronology', () => {
qs: {
lookfor: 'jugendliteratur mittelalter roman',
type: 'allFields',
limit: '65'
limit: '65'
}
})
})

// see #40
// 1st hit published 1985, 2nd 2002, 3rd 2011
// definition of relevance?
// 1st hit published 1985, 2nd 2002, 3rd 2011
// definition of relevance?
it('should show these items', () => {
cy.get('[href*="272952737"]')
.should('exist')
Expand All @@ -198,8 +199,8 @@ describe('Chronology', () => {
.should('exist')

})
it.skip('Later editions should be ranked higher', () => {

it.skip('Later editions should be ranked higher', () => {
cy.get('[href*="1016493053"]')
.parents('[id^="result"]')
.find('.record-number')
Expand Down Expand Up @@ -243,14 +244,14 @@ describe('Chronology', () => {

// 1756833699
// not sure if this should or should not exist
// definition of relevance?
// definition of relevance?
// see #35
it.skip('should show relevant titles according to chronology', () => {
cy.get('[href*="1756833699"]')
.should('exist')
})


})

describe('koptische Stoffe', () => {
Expand Down Expand Up @@ -311,4 +312,30 @@ describe('Chronology', () => {
})
})
})

describe('future publication', () => {
// see #58
// run a query for publications 5 years from noww
beforeEach(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: '*',
type: 'allFields',
'daterange[]': 'publishDate',
publishDatefrom: new Date().getFullYear() + 5,
limit: 10
}
})
})
// most results are data errors
// e.g. https://stabikat.de/Record/181994543X publishDate = 2029 Display Date = [2020]
// hence we make a very weak assertion (instead of iterating through each result)
it('TOP10 should contain a future publication date', () => {

const now = new Date().getFullYear() + 5
cy.get('.resultlist-data')
.contains(now)
})
})
})

0 comments on commit 2399590

Please sign in to comment.