openpencil/tests/engine/app/storage/format-bytes.test.ts
Danila Poyarkov 56a3b77ac5 feat(app): add local-first storage substrate
- Recover the IndexedDB and in-memory document cache behind the storage domain

- Add persistent outbox supersession, cache eviction, import validation, and naming helpers

- Keep the substrate provider-neutral and cover its pure behavior

Co-authored-by: Rob Coenen <753704+rcoenen@users.noreply.github.com>
2026-07-26 14:30:39 +03:00

13 lines
411 B
TypeScript

import { describe, expect, test } from 'bun:test'
import { formatStorageBytes } from '@/app/storage/format-bytes'
describe('formatStorageBytes', () => {
test('formats common sizes', () => {
expect(formatStorageBytes(0)).toBe('0 B')
expect(formatStorageBytes(512)).toBe('512 B')
expect(formatStorageBytes(2048)).toBe('2 KB')
expect(formatStorageBytes(1024 * 1024 * 3)).toBe('3.0 MB')
})
})