diff --git a/packages/react-router/__tests__/router/fetchers-test.ts b/packages/react-router/__tests__/router/fetchers-test.ts index 504e68d750..2fa7b1c0b5 100644 --- a/packages/react-router/__tests__/router/fetchers-test.ts +++ b/packages/react-router/__tests__/router/fetchers-test.ts @@ -169,7 +169,7 @@ describe("fetchers", () => { formData: createFormData({ key: "value" }), }); expect(A.fetcher.state).toBe("loading"); - expect(A.fetcher.formMethod).toBe("get"); + expect(A.fetcher.formMethod).toBe("GET"); expect(A.fetcher.formAction).toBe("/foo"); expect(A.fetcher.formData).toEqual(createFormData({ key: "value" })); expect(A.fetcher.formEncType).toBe("application/x-www-form-urlencoded"); @@ -2111,7 +2111,7 @@ describe("fetchers", () => { "formAction": "/two/three", "formData": FormData {}, "formEncType": "application/x-www-form-urlencoded", - "formMethod": "post", + "formMethod": "POST", "json": undefined, "nextParams": { "a": "two", diff --git a/packages/react-router/__tests__/router/navigation-test.ts b/packages/react-router/__tests__/router/navigation-test.ts index a21cc3dcfa..909cff68f8 100644 --- a/packages/react-router/__tests__/router/navigation-test.ts +++ b/packages/react-router/__tests__/router/navigation-test.ts @@ -1154,7 +1154,7 @@ describe("navigations", () => { // @ts-expect-error new URLSearchParams(navigation.formData).toString() ).toBe("gosh=dang"); - expect(navigation.formMethod).toBe("post"); + expect(navigation.formMethod).toBe("POST"); expect(navigation.formEncType).toBe("application/x-www-form-urlencoded"); expect(navigation.location).toMatchObject({ pathname: "/foo", @@ -1169,7 +1169,7 @@ describe("navigations", () => { // @ts-expect-error new URLSearchParams(navigation.formData).toString() ).toBe("gosh=dang"); - expect(navigation.formMethod).toBe("post"); + expect(navigation.formMethod).toBe("POST"); expect(navigation.formEncType).toBe("application/x-www-form-urlencoded"); expect(navigation.location).toMatchObject({ pathname: "/foo", @@ -1203,7 +1203,7 @@ describe("navigations", () => { // @ts-expect-error new URLSearchParams(navigation.formData).toString() ).toBe("gosh=dang"); - expect(navigation.formMethod).toBe("post"); + expect(navigation.formMethod).toBe("POST"); expect(navigation.location).toMatchObject({ pathname: "/bar", search: "", @@ -1229,7 +1229,7 @@ describe("navigations", () => { let navigation = t.router.state.navigation; expect(navigation.state).toBe("loading"); expect(navigation.formData).toEqual(createFormData({ gosh: "dang" })); - expect(navigation.formMethod).toBe("get"); + expect(navigation.formMethod).toBe("GET"); expect(navigation.formEncType).toBe("application/x-www-form-urlencoded"); expect(navigation.location).toMatchObject({ pathname: "/foo", @@ -1257,7 +1257,7 @@ describe("navigations", () => { let navigation = t.router.state.navigation; expect(navigation.state).toBe("loading"); expect(navigation.formData).toEqual(createFormData({ gosh: "dang" })); - expect(navigation.formMethod).toBe("get"); + expect(navigation.formMethod).toBe("GET"); expect(navigation.formEncType).toBe("application/x-www-form-urlencoded"); expect(navigation.location?.pathname).toBe("/bar"); diff --git a/packages/react-router/__tests__/router/revalidate-test.ts b/packages/react-router/__tests__/router/revalidate-test.ts index 8f15661e36..3255fd4397 100644 --- a/packages/react-router/__tests__/router/revalidate-test.ts +++ b/packages/react-router/__tests__/router/revalidate-test.ts @@ -271,7 +271,7 @@ describe("router.revalidate", () => { pathname: "/tasks", search: "?key=value", }, - formMethod: "get", + formMethod: "GET", formData: createFormData({ key: "value" }), }, revalidation: "loading", diff --git a/packages/react-router/__tests__/router/router-test.ts b/packages/react-router/__tests__/router/router-test.ts index 929c075460..49ba868309 100644 --- a/packages/react-router/__tests__/router/router-test.ts +++ b/packages/react-router/__tests__/router/router-test.ts @@ -690,7 +690,7 @@ describe("a router", () => { pathname: "/tasks", search: "?key=value", }); - expect(t.router.state.navigation.formMethod).toBe("get"); + expect(t.router.state.navigation.formMethod).toBe("GET"); expect(t.router.state.navigation.formData).toEqual( createFormData({ key: "value" }) ); @@ -710,7 +710,7 @@ describe("a router", () => { pathname: "/tasks", search: "?key=value", }); - expect(t.router.state.navigation.formMethod).toBe("get"); + expect(t.router.state.navigation.formMethod).toBe("GET"); expect(t.router.state.navigation.formData).toEqual( createFormData({ key: "value" }) ); @@ -730,7 +730,7 @@ describe("a router", () => { pathname: "/tasks", search: "?key=2", }); - expect(t.router.state.navigation.formMethod).toBe("get"); + expect(t.router.state.navigation.formMethod).toBe("GET"); expect(t.router.state.navigation.formData).toEqual( createFormData({ key: "2" }) ); @@ -750,7 +750,7 @@ describe("a router", () => { pathname: "/tasks", search: "?key=1", }); - expect(t.router.state.navigation.formMethod).toBe("post"); + expect(t.router.state.navigation.formMethod).toBe("POST"); expect(t.router.state.navigation.formData).toEqual( createFormData({ key: "2" }) ); diff --git a/packages/react-router/__tests__/router/should-revalidate-test.ts b/packages/react-router/__tests__/router/should-revalidate-test.ts index f1aebc5f38..69037af7ed 100644 --- a/packages/react-router/__tests__/router/should-revalidate-test.ts +++ b/packages/react-router/__tests__/router/should-revalidate-test.ts @@ -256,7 +256,7 @@ describe("shouldRevalidate", () => { nextParams: {}, nextUrl: expect.urlMatch("http://localhost/child"), defaultShouldRevalidate: true, - formMethod: "post", + formMethod: "POST", formAction: "/child", formEncType: "application/x-www-form-urlencoded", actionResult: "ACTION", @@ -310,7 +310,7 @@ describe("shouldRevalidate", () => { nextParams: {}, nextUrl: expect.urlMatch("http://localhost/"), defaultShouldRevalidate: true, - formMethod: "post", + formMethod: "POST", formAction: "/child", formEncType: "application/x-www-form-urlencoded", actionResult: undefined, @@ -364,7 +364,7 @@ describe("shouldRevalidate", () => { nextParams: {}, nextUrl: expect.urlMatch("http://localhost/child"), defaultShouldRevalidate: true, - formMethod: "post", + formMethod: "POST", formAction: "/child", formEncType: "application/x-www-form-urlencoded", actionResult: "ACTION", @@ -406,7 +406,7 @@ describe("shouldRevalidate", () => { // @ts-expect-error let arg = shouldRevalidate.mock.calls[0][0]; let expectedArg: Partial = { - formMethod: "post", + formMethod: "POST", formAction: "/", formEncType: "application/json", text: undefined, @@ -448,7 +448,7 @@ describe("shouldRevalidate", () => { // @ts-expect-error let arg = shouldRevalidate.mock.calls[0][0]; let expectedArg: Partial = { - formMethod: "post", + formMethod: "POST", formAction: "/", formEncType: "text/plain", text: "hello world", @@ -657,7 +657,7 @@ describe("shouldRevalidate", () => { formAction: "/child", formData: createFormData({}), formEncType: "application/x-www-form-urlencoded", - formMethod: "post", + formMethod: "POST", defaultShouldRevalidate: true, }); @@ -715,7 +715,7 @@ describe("shouldRevalidate", () => { "formAction": "/fetch", "formData": FormData {}, "formEncType": "application/x-www-form-urlencoded", - "formMethod": "post", + "formMethod": "POST", "json": undefined, "nextParams": {}, "nextUrl": "http://localhost/", @@ -779,7 +779,7 @@ describe("shouldRevalidate", () => { "formAction": "/fetch", "formData": FormData {}, "formEncType": "application/x-www-form-urlencoded", - "formMethod": "post", + "formMethod": "POST", "json": undefined, "nextParams": {}, "nextUrl": "http://localhost/", diff --git a/packages/react-router/__tests__/router/submission-test.ts b/packages/react-router/__tests__/router/submission-test.ts index 520e57fc33..8c49a593b4 100644 --- a/packages/react-router/__tests__/router/submission-test.ts +++ b/packages/react-router/__tests__/router/submission-test.ts @@ -504,16 +504,16 @@ describe("submissions", () => { formMethod: "get", formData: createFormData({}), }); - expect(t.router.state.navigation.formMethod).toBe("get"); + expect(t.router.state.navigation.formMethod).toBe("GET"); await A.loaders.child.resolve("LOADER"); expect(t.router.state.navigation.formMethod).toBeUndefined(); await t.router.navigate("/"); let B = await t.navigate("/child", { - formMethod: "POST", + formMethod: "post", formData: createFormData({}), }); - expect(t.router.state.navigation.formMethod).toBe("post"); + expect(t.router.state.navigation.formMethod).toBe("POST"); await B.actions.child.resolve("ACTION"); await B.loaders.child.resolve("LOADER"); expect(t.router.state.navigation.formMethod).toBeUndefined(); @@ -523,15 +523,15 @@ describe("submissions", () => { formMethod: "GET", formData: createFormData({}), }); - expect(t.router.state.fetchers.get("key")?.formMethod).toBe("get"); + expect(t.router.state.fetchers.get("key")?.formMethod).toBe("GET"); await C.loaders.child.resolve("LOADER FETCH"); expect(t.router.state.fetchers.get("key")?.formMethod).toBeUndefined(); let D = await t.fetch("/child", "key", { - formMethod: "post", + formMethod: "POST", formData: createFormData({}), }); - expect(t.router.state.fetchers.get("key")?.formMethod).toBe("post"); + expect(t.router.state.fetchers.get("key")?.formMethod).toBe("POST"); await D.actions.child.resolve("ACTION FETCH"); expect(t.router.state.fetchers.get("key")?.formMethod).toBeUndefined(); });