feat!: client storage is read-only, storage.save and storage.delete removed

This commit is contained in:
edmand46
2026-09-29 16:43:15 +03:00
parent b115450715
commit 17a55888a5
11 changed files with 28 additions and 104 deletions
+2 -10
View File
@@ -2,18 +2,10 @@ import { describe, it, expect } from 'vitest';
import { freshPlayer } from './_setup/harness.js';
describe('e2e-prod: storage', () => {
it('save -> get -> delete round-trip', async () => {
it('a fresh player reads empty storage', async () => {
const client = await freshPlayer();
const payload = JSON.stringify({ level: 7 });
await client.storage.save('savegame', payload);
const got = await client.storage.reload();
expect(got.items?.some((i) => i.type === 'savegame' && i.data === payload)).toBe(true);
await client.storage.delete('savegame');
const after = await client.storage.reload();
expect(after.items?.some((i) => i.type === 'savegame')).toBeFalsy();
expect(got.items ?? []).toEqual([]);
});
});