Skip to content

Commit

Permalink
test: Handle default export in swr (#3559)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Aug 26, 2024
1 parent cac0464 commit f0c257d
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,17 @@ const proposedAddressProps = {
"findProperty.action": "Proposed a new address",
};

// vi.spyOn(SWR, "default").mockImplementation((url: any) => {
// return {
// data: url()?.startsWith("https://www.planning.data.gov.uk")
// ? localAuthorityMock
// : null,
// } as any;
// });

describe.skip("render states", () => {
vi.mock("swr", () => ({
default: vi.fn((url: any) => {
return {
data: url()?.startsWith("https://www.planning.data.gov.uk")

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

'
https://www.planning.data.gov.uk
' may be followed by an arbitrary host name.
? localAuthorityMock
: null,
};
}),
}));

describe("render states", () => {
it("renders correctly and defaults to the address autocomplete page", async () => {
const handleSubmit = vi.fn();

Expand Down Expand Up @@ -299,7 +301,7 @@ describe.skip("render states", () => {
});
});

describe.skip("picking an OS address", () => {
describe("picking an OS address", () => {
it("displays an error if you submit an invalid postcode", async () => {
const handleSubmit = vi.fn();

Expand Down Expand Up @@ -384,7 +386,7 @@ describe.skip("picking an OS address", () => {
});
});

describe.skip("plotting a new address that does not have a uprn yet", () => {
describe("plotting a new address that does not have a uprn yet", () => {
it("displays an error if you haven't entered a site address", async () => {
const handleSubmit = vi.fn();

Expand Down

0 comments on commit f0c257d

Please sign in to comment.