| 1 | import { setLocalStorage } from "./localStorage"; |
| 2 | |
| 3 | describe("localStorage Test", () => { |
| 4 | beforeEach(() => { |
| 5 | localStorage.clear(); |
| 6 | }); |
| 7 | |
| 8 | it("should stringify and set value in localStorage", () => { |
| 9 | const MOCK_ONBOARDING_STATUS_VALUE = "Started"; |
| 10 | setLocalStorage("onboardingStatus", MOCK_ONBOARDING_STATUS_VALUE); |
| 11 | expect(JSON.parse(localStorage.getItem("onboardingStatus") || "")).toEqual( |
| 12 | MOCK_ONBOARDING_STATUS_VALUE, |
| 13 | ); |
| 14 | }); |
| 15 | }); |