diff --git a/src/lib/__tests__/stateCookie.test.ts b/src/lib/__tests__/stateCookie.test.ts index 1104ebb..918b0c0 100644 --- a/src/lib/__tests__/stateCookie.test.ts +++ b/src/lib/__tests__/stateCookie.test.ts @@ -6,16 +6,19 @@ describe("setStateCookie", () => { expect(() => setStateCookie("")) .toThrow("state value is required") }) + test("sets cookie with prefix app.txs", () => { const state = setStateCookie("code_verifier_secret") expect(document.cookie) .toMatch(`app.txs.${state}=code_verifier_secret`) }) + test("sets cookie with latest value", () => { const state = setStateCookie("code_verifier_secret") expect(document.cookie) .toMatch(`app.txs.${state}=code_verifier_secret`) }) + test("returns state", () => { const state = setStateCookie("code_verifier_secret") expect(state).toMatch(/[\w-]+/)