Split browser workflows from presentation

This commit is contained in:
ms2k 2026-07-20 03:37:35 +09:00
commit 0c2d992224

View file

@ -171,6 +171,20 @@ test('declared, undeclared, and network failures remain distinct without retries
assert.equal(attempts, 1);
});
test('logout keeps session mutation policy in the transport', async () => {
const calls = [];
const client = new BrowserProductClient(async (input, init) => {
calls.push({ input, init });
return new Response(null, { status: 204 });
});
await client.logout('csrf-token');
assert.equal(calls.length, 1);
assert.equal(calls[0].input, '/logout');
assert.equal(calls[0].init.method, 'POST');
assert.equal(calls[0].init.credentials, 'same-origin');
assert.equal(calls[0].init.headers['X-CSRF-Token'], 'csrf-token');
});
test('checked generated artifact contains no transport policy', async () => {
const generated = await readFile(
new URL('../src/generated/contract.ts', import.meta.url),