diff --git a/packages/react-router/__tests__/context-test.tsx b/packages/react-router/__tests__/context-test.tsx new file mode 100644 index 0000000000..77e1be5cc7 --- /dev/null +++ b/packages/react-router/__tests__/context-test.tsx @@ -0,0 +1,161 @@ +/* eslint-disable @typescript-eslint/no-unused-vars -- type tests */ +/* eslint-disable jest/expect-expect -- type tests */ +import * as React from "react"; +import { + UNSAFE_LocationContext as LocationContext, + NavigationType, +} from "react-router"; + +const location = { + pathname: "", + search: "", + hash: "", + state: null, + key: "default", +} as const; + +describe("LocationContext", () => { + it("accepts an object with the correct `pathname`", () => { + const validCases = [ + , + , + , + ]; + }); + + it("accepts an object with the correct `hash`", () => { + const validCases = [ + , + , + , + ]; + }); + + it("accepts an object with the correct `search`", () => { + const validCases = [ + , + , + , + ]; + }); +}); + +it("rejects an object with the wrong `pathname`", () => { + const invalidCases = [ + , + , + ]; + + it("rejects an object with the wrong `hash`", () => { + const invalidCases = [ + , + , + ]; + + it("rejects an object with the wrong `search`", () => { + const invalidCases = [ + , + , + ]; + }); + }); +});