Commit ee08593c authored by Magnus Westergaard's avatar Magnus Westergaard
Browse files

DEICH-5753: Add a couple more tests.

parent a7aa80b4
......@@ -10,6 +10,8 @@ describe("Deichman.no - search", () => {
cy.importAndIndexGraphData("testdata/deichman.no/search_spec/publications.ttl", "https://katalog.deichman.no", "publication", 11)
})
// NOTE: to save setup time, none of the publications have items
it("can search using free text", () => {
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/kattekrigerne?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 1)
......@@ -34,7 +36,7 @@ describe("Deichman.no - search", () => {
cy.get("[data-cy=work-card-title]").eq(0).should("have.text", "Kattekrigerne slår tilbake mot hundekrigerne")
})
it("does not use prefix matching for field search", () => {
it("does not implicitly use prefix matching for field search", () => {
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/tittel:kattekr?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 0)
})
......@@ -49,12 +51,29 @@ describe("Deichman.no - search", () => {
cy.get("[data-cy=work-card-title]").eq(0).should("have.text", "Kattekrigerne slår tilbake mot hundekrigerne")
})
it("supports phrase search", () => {
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/"vis steinens"?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 1)
cy.get("[data-cy=work-card-title]").eq(0).should("have.text", "Garry Fotter og vis steinens")
})
it("supports phrases for field search", () => {
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/tittel:"vis steinens"?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 1)
cy.get("[data-cy=work-card-title]").eq(0).should("have.text", "Garry Fotter og vis steinens")
})
it("supports special characters in field search", () => {
const encodedPersonUri = encodeURIComponent("http://data.deichman.no/person/p001")
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/work.mainEntryInfo.uri:"${encodedPersonUri}"?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 1)
cy.get("[data-cy=work-card-title]").eq(0).should("have.text", "Å være en hærfører")
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/emne:"Techno (musikk)"?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 1)
cy.get("[data-cy=work-card-title]").eq(0).should("have.text", "Utgivelse 4")
})
it("supports boolean operators OR/NOT", () => {
cy.visit(`${Cypress.env("DEICHMAN_NO_URL")}/sok/garry NOT steinens?includeWithoutItems=includeWithoutItems`)
cy.get("[data-cy=work-card-title]").should("have.length", 1)
......
......@@ -146,7 +146,8 @@
deich:MainEntry ;
deich:agent <person/p003> ;
deich:role role:author
] .
] ;
deich:subject <subject/s001> .
<work/w005>
a deich:Work ;
......@@ -171,3 +172,9 @@
<person/p003>
a deich:Person ;
deich:name "Tre, Forfatter" .
# subjects
<subject/s001>
a deich:Subject ;
deich:prefLabel "Techno" ;
deich:specification "Musikk" .
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment