Split browser workflows from presentation
This commit is contained in:
parent
c9642f4067
commit
0c2d992224
1 changed files with 1683 additions and 854 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in a new issue