Skip to content

Commit

Permalink
Update others tests to work with best represetation queries
Browse files Browse the repository at this point in the history
Our current graphQL mocking does not seem to support varying responses 
by operation. This means we cannot provide different responses when 
looking upmaterial data for singular and parallel reservations.

Update with singular use cases to use best representation work fixture
where possibe.

When tests mix parallel and normal reservations we revert to only using
normal reservations.
  • Loading branch information
kasperg committed Nov 16, 2023
1 parent 12f81a2 commit acf5d70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 56 deletions.
17 changes: 1 addition & 16 deletions src/apps/dashboard/dashboard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1270,22 +1270,7 @@ describe("Dashboard", () => {
pickupNumber: null,
ilBibliographicRecord: null,
transactionId: "cae4db22-e267-4087-bdaa-d880bef19b52",
reservationType: "parallel"
},
{
reservationId: 67843847,
recordId: "62485125",
state: "reserved",
pickupBranch: "DK-775100",
pickupDeadline: null,
expiryDate: "2022-12-12",
dateOfReservation: "2022-06-15T11:41:24.075",
numberInQueue: 206,
periodical: null,
pickupNumber: null,
ilBibliographicRecord: null,
transactionId: "cae4db22-e267-4087-bdaa-d880bef19b52",
reservationType: "parallel"
reservationType: "normal"
}
]
}
Expand Down
17 changes: 1 addition & 16 deletions src/apps/reservation-list/list/reservation-list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,7 @@ describe("Reservation list", () => {
pickupNumber: null,
ilBibliographicRecord: null,
transactionId: "cae4db22-e267-4087-bdaa-d880bef19b52",
reservationType: "parallel"
},
{
reservationId: 67843847,
recordId: "62485125",
state: "reserved",
pickupBranch: "DK-775100",
pickupDeadline: null,
expiryDate: "2022-12-12",
dateOfReservation: "2022-06-15T11:41:24.075",
numberInQueue: 206,
periodical: null,
pickupNumber: null,
ilBibliographicRecord: null,
transactionId: "cae4db22-e267-4087-bdaa-d880bef19b52",
reservationType: "parallel"
reservationType: "normal"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,29 +269,12 @@ describe("Delete reservation modal", () => {
]
}).as("get-reservations");

cy.intercept("POST", "**/next/**", {
statusCode: 200,
body: {
data: {
manifestation: {
pid: "870970-basis:27215815",
titles: { full: ["Dummy Some Title"] },
abstract: ["Dummy Some abstract ..."],
edition: {
summary: "3. udgave, 1. oplag (2019)",
publicationYear: {
display: "2006"
}
},
materialTypes: [{ specific: "Dummy bog" }],
creators: [
{ display: "Dummy Jens Jensen" },
{ display: "Dummy Some Corporation" }
]
}
}
}
}).as("get-manifestation");
cy.interceptRest({
aliasName: "get-manifestation",
httpMethod: "POST",
url: "**/next/**",
fixtureFilePath: "reservation-list/work-bestrepresentation.json"
});

cy.intercept(
"DELETE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ describe("Reservation details modal", () => {
aliasName: "work",
httpMethod: "POST",
url: "**/next/**",
fixtureFilePath: "reservation-list/work.json"
fixtureFilePath: "reservation-list/work-bestrepresentation.json"
});

cy.intercept(
Expand Down

0 comments on commit acf5d70

Please sign in to comment.