import { describe, expect, it } from 'vitest'
import { loadRecord } from './browser-storage'

describe('loadRecord', () => {
  it('returns only string key/value entries', () => {
    localStorage.setItem('test-record', JSON.stringify({ good: 'value', bad: 1 }))
    expect(loadRecord('test-record', (value): value is string => typeof value === 'string')).toEqual({ good: 'value' })
  })
})
