feat!: client storage is read-only, storage.save and storage.delete removed
This commit is contained in:
@@ -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([]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user