Files
rudder-js-sdk/test/e2e-prod/storage.e2e.test.ts
T

20 lines
654 B
TypeScript
Raw Normal View History

2026-08-12 14:02:25 +03:00
import { describe, it, expect } from 'vitest';
import { freshPlayer } from './_setup/harness.js';
describe('e2e-prod: storage', () => {
it('save -> get -> delete round-trip', async () => {
const client = await freshPlayer();
const payload = JSON.stringify({ level: 7 });
await client.storage.save('savegame', payload);
2026-08-12 14:02:25 +03:00
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();
2026-08-12 14:02:25 +03:00
});
});