import { describe, expect, it } from 'vitest'; import { exportCharacterJson, importCharacterFromText } from '$lib/storage/io'; import { newCharacter } from '$lib/characters/default'; describe('io', () => { it('roundtrips JSON', () => { const c = newCharacter({ name: 'IO', id: '00000000-0000-4000-8000-0000000000aa' }); const json = exportCharacterJson(c); const back = importCharacterFromText(json, 'json'); expect(back.meta.name).toBe('IO'); expect(back.id).toBe(c.id); }); });