Skip to content

Commit 765f72c

Browse files
committed
test(console): the cookie control counts the provider's own read of a signed-out answer
Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
1 parent 916ded0 commit 765f72c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎ui/apps/console/src/__tests__/sessionCheckBootDedup.test.tsx‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -980,19 +980,25 @@ describe('a bearer-only session: the stored Bearer rides me/localization on all
980980
expect(authorizationOf(localizationCalls()[0])).toBe(`Bearer ${BEARER}`);
981981
});
982982

983-
it('CONTROL: no stored token, the cookie session: one request, no Authorization, as before', async () => {
983+
it('CONTROL: no stored token, the cookie session: no Authorization on any leg, as before', async () => {
984984
parse();
985985
await settle();
986986
await seedTenantLanguage('', 1_000);
987+
// The seed took the parse-time request: one so far.
988+
expect(localizationCalls()).toHaveLength(1);
987989
render(
988990
<LocalizationFetchProvider endpoint={ME}>
989991
<Value />
990992
</LocalizationFetchProvider>,
991993
);
992994
await settle();
993-
expect(localizationCalls()).toHaveLength(1);
994-
expect(localizationCalls()[0]![1]).toMatchObject({ credentials: 'include' });
995-
expect(authorizationOf(localizationCalls()[0])).toBeNull();
995+
// A signed-out answer is never handed to the provider, which asks itself,
996+
// exactly as before this change.
997+
expect(localizationCalls()).toHaveLength(2);
998+
for (const call of localizationCalls()) {
999+
expect(call[1]).toMatchObject({ credentials: 'include' });
1000+
expect(authorizationOf(call)).toBeNull();
1001+
}
9961002
// The bearer-only server cannot see it: nothing of the user's is cached or shown.
9971003
expect(readCachedLanguageSeed()).toBeNull();
9981004
expect(screen.getByTestId('localization').textContent).toBe('-/-');

0 commit comments

Comments
 (0)