Skip to content

Commit

Permalink
Assert that FBS is called when doing updates in reservation details test
Browse files Browse the repository at this point in the history
This should allow us to to verify that requests with the expected
payloads are sent.
  • Loading branch information
kasperg committed Nov 14, 2023
1 parent bce4455 commit 104558a
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,23 @@ describe("Reservation details modal", () => {

cy.getBySel("modal-cta-button").should("be.be.visible").click();

cy.wait("@put-library-branch-and-expiry-date").should(({ request }) => {
expect(JSON.stringify(request.body)).to.equal(
JSON.stringify({
reservations: [
{
expiryDate: "2022-09-21",
// TODO: This should be DK-775120 as this is what the user
// selected in previous steps but that does not seem to work
// right now.
pickupBranch: "DK-775160",
reservationId: 4698559133
}
]
})
);
});

// ID 13 2.f. header "Not interested after"
cy.getBySel("reservation-form-list-item")
.eq(2)
Expand Down Expand Up @@ -514,6 +531,21 @@ describe("Reservation details modal", () => {

cy.getBySel("modal-cta-button").should("be.be.visible").click();

cy.wait("@put-library-branch-and-expiry-date").should(({ request }) => {
expect(JSON.stringify(request.body)).to.equal(
JSON.stringify({
reservations: [
{
// TODO This should be updated to reflect the new interest date
expiryDate: "2022-09-21",
pickupBranch: "DK-775120",
reservationId: 4698559133
}
]
})
);
});

// ID 15 2.i still on "detaljevisning"
// ID 16 6. user clicks save
cy.get(".modal").should("exist");
Expand Down

0 comments on commit 104558a

Please sign in to comment.