Skip to content

Commit

Permalink
fix(simple): parents first
Browse files Browse the repository at this point in the history
should pass after 09.01.24 deployment

close #8
  • Loading branch information
duncdrum committed Jan 5, 2024
1 parent 918d9bd commit fea0ec7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 40 deletions.
14 changes: 7 additions & 7 deletions cypress/e2e/known-Item.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ describe.skip('known item searches', () => {
})
})

it('Parent before child', () => {
cy.visit('/', {
qs: {
q: 'African American Review'
},
})
})
// it('Parent before child', () => {
// cy.visit('/', {
// qs: {
// q: 'African American Review'
// },
// })
// })

it('child should be first when child is searched', () => {
cy.visit('/', {
Expand Down
77 changes: 44 additions & 33 deletions cypress/e2e/simple.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@


describe('simple GUI spec', () => {
before(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'dad',
type: 'AllFields'
}
})
})

it('should see matching search results', () => {
cy.get('#content')
.contains('Dad')
before(() => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'dad',
type: 'AllFields'
}
})
})

// This will be a 403 from world should connect from internal network
it('should also pass via http request', () => {
cy.request({
url: '/Results',
qs: {
lookfor: 'dad'
}
}).then((resp) => {
expect(resp.status).to.eq(200)
})
it('should see matching search results', () => {
cy.get('.resultlist')
.contains('Dad')
})

// This will be a 403 from world should connect from internal network
it('should also pass via http request', () => {
cy.request({
url: '/Results',
qs: {
lookfor: 'dad'
}
}).then((resp) => {
expect(resp.status).to.eq(200)
})

describe('Foreign language phrase search', () => {
})

describe('Foreign language phrase search', () => {
// See #6
// Thematische Suche#L30
it('en all fields query matches en not ar', () => {
Expand Down Expand Up @@ -61,24 +61,35 @@ describe('Foreign language phrase search', () => {
cy.get('.resultlist')
// PPN JST063665204
.contains('The Egyptian Language')
cy.get('.resultlist')
cy.get('.resultlist')
// PPN DOAJ008736839
.contains('المعانی الثانیة للأمر فی النص المصری القدیم دراسة بلاغیة مقارنة ')

})
})

// TODO(DP): get json repsonse from console
it('passes via http request', () => {
cy.request({
// see #8
// 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
//
describe('Parent Work', () => {
it('should appear before child work', () => {
cy.visit({
url: '/Results',
qs: {
lookfor: 'dad'
lookfor: 'African American Review',
type: 'Title',
"filter[]": '~remote_bool:"false"'
}
}).then((resp) => {
expect(resp.status).to.eq(200)
cy.log(resp)
})
cy.get('#result0')
.find('.media-type')
.contains(' Zeitschrift (gedruckt) ')
cy.get('#result1')
.find('.media-type')
.contains(' Band einer Zeitschrift/Zeitung ')

})
})
})
})

0 comments on commit fea0ec7

Please sign in to comment.