Skip to content

Commit

Permalink
fix(InfoPageContainer.test.tsx): change mockSlug value from "dfp-paym…
Browse files Browse the repository at this point in the history
…ent" to "frontpage-payment" for accurate testing

The mockSlug value is changed from "dfp-payment" to "frontpage-payment" to ensure accurate testing of the InfoPageContainer component.
  • Loading branch information
ktun95 committed Feb 11, 2024
1 parent 8a48ad1 commit cbdbcaa
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ window.getSelection = vi.fn()
const mockName = "payment"

vi.mock("react-router-dom", async () => {
const originalModule =
await vi.importActual<typeof import("react-router-dom")>("react-router-dom")
const originalModule = await vi.importActual<
typeof import("react-router-dom")
>("react-router-dom")
return {
...originalModule,
useParams: () => ({
Expand All @@ -22,7 +23,7 @@ vi.mock("react-router-dom", async () => {

const mockContent = `{"root":{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"Test Content","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"heading","version":1,"tag":"h1"},{"children":[{"children":[{"detail":0,"format":0,"mode":"normal","style":"","text":"International conferences dedicated to ","type":"text","version":1},{"detail":0,"format":2,"mode":"normal","style":"","text":"Dictyostelium","type":"text","version":1},{"detail":0,"format":0,"mode":"normal","style":"","text":" started in 1977 with the meeting in Sardinia, and continued on a roughly 3-year cycle into the 1980's. However, as the field became more active, more local meetings sprang up to fill the gaps in the cycle. Notable amongst these was an annual series in the UK, which gradually became more international. By the late 1980's with the successive meetings at Amsterdam, Oxford, Airlie and Cambridge, the current pattern of annual meetings was established. Interestingly in the late 1990's as the field expanded further, local meetings were re-started in several countries. ","type":"text","version":1}],"direction":"ltr","format":"","indent":0,"type":"paragraph","version":1}],"direction":"ltr","format":"","indent":0,"type":"flex-layout","version":1}],"direction":"ltr","format":"","indent":0,"type":"root","version":1}}`

const mockSlug = "dfp-payment"
const mockSlug = "frontpage-payment"

describe("features/EditablePages/InfoPageContainer", () => {
const MockComponent = ({ mocks }: any) => (
Expand Down

0 comments on commit cbdbcaa

Please sign in to comment.