test: update tests for security fixes (origin validation, streaming state)
- archyIntegration: expect window.location.origin instead of '*' for postMessage calls (matches FIX-009 origin restriction) - useAI: fix flaky isStreaming assertion to account for background fetch calls (refreshWavlakeCatalog) captured before streaming starts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9adeab9420
commit
e97c8f36ac
@@ -223,8 +223,9 @@ describe('useAI', () => {
|
||||
expect(chatStore.isStreaming).toBe(false)
|
||||
await sendMessage('hi')
|
||||
expect(chatStore.isStreaming).toBe(false)
|
||||
// During the fetch call, isStreaming should have been true
|
||||
expect(streamingStates[0]).toBe(true)
|
||||
// During the streaming fetch call, isStreaming should have been true
|
||||
// (earlier non-streaming fetches like refreshWavlakeCatalog may also be captured)
|
||||
expect(streamingStates.some(s => s === true)).toBe(true)
|
||||
})
|
||||
|
||||
it('handles stream errors gracefully', async () => {
|
||||
|
||||
Reference in New Issue
Block a user