({ name, id = name }: { name: string; id?: string })
| 14 | const project = () => `view-preference-test-${++nextProject}`; |
| 15 | const store = (name: string, preferences: unknown, version = 1) => window.localStorage.setItem(viewPreferencesKey(name), JSON.stringify({ version, preferences })); |
| 16 | function Probe({ name, id = name }: { name: string; id?: string }) { |
| 17 | const state = useViewPreferences(name); |
| 18 | const [selected, select] = useState(false); |
| 19 | controls.set(id, state); |
| 20 | return <button data-testid={id} onClick={() => select(true)}>{JSON.stringify({ ...state.preferences, selected })}</button>; |
| 21 | } |
| 22 | beforeEach(() => { |
| 23 | (globalThis as unknown as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true; |
| 24 | // Node exposes its own storage global; use the actual jsdom browser store. |
nothing calls this directly
no test coverage detected