Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Use AvailabilityFactory instead of fixture in material test
Browse files Browse the repository at this point in the history
This should show that the approach works in practice.

We cannot use interceptRest here as it requires a filename argument.
  • Loading branch information
kasperg committed Jul 10, 2023
1 parent 36edb09 commit 918d2dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/apps/material/material.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AvailabilityFactory from "../../../cypress/factories/availability";

const coverUrlPattern = /^https:\/\/res\.cloudinary\.com\/.*\.(jpg|jpeg|png)$/;

describe("Material", () => {
Expand Down Expand Up @@ -297,11 +299,11 @@ describe("Material", () => {
fixtureFilePath: "cover.json"
});

cy.interceptRest({
aliasName: "Availability",
url: "**/availability/v3?recordid=**",
fixtureFilePath: "material/availability.json"
});
cy.intercept(
"GET",
"**/availability/v3?recordid=**",
AvailabilityFactory.buildList(1, { recordId: "46615743" })
).as("Availability");

// Intercept like button
cy.intercept("HEAD", "**/list/default/**", {
Expand Down

0 comments on commit 918d2dc

Please sign in to comment.