Skip to content

Commit 5e21f8e

Browse files
committed
chore(extension): tighten production QA evidence
1 parent c62e455 commit 5e21f8e

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

‎apps/sim/scripts/test-browser-extension-e2e.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,9 @@ try {
12631263
assert.equal(chat.organization_id, organizationId)
12641264
assert.equal(chat.workspace_id, null)
12651265
assert.equal(toRecord(chat.config).conversationMode, 'assistant')
1266+
await expect(
1267+
frame().getByRole('button', { name: 'Copy message', exact: true })
1268+
).toBeVisible({ timeout: 120_000 })
12661269
await screenshot('organization-assistant-response')
12671270
} else await shell.unroute('**/api/mothership/chat')
12681271
}

‎apps/sim/scripts/test-organization-search-e2e.ts‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ const documentResponses: {
7272
status: number
7373
headers: Record<string, string>
7474
}[] = []
75+
let deniedDocument: {
76+
url: string
77+
status: number
78+
bytes: number
79+
suspenseTemplates: string[]
80+
suspenseMarkers: string[]
81+
suspenseInstructions: string[]
82+
robots: string[]
83+
} | null = null
7584
let browserErrorCount = 0
7685
let browserErrorEventCount = 0
7786
let currentCheck = 'Setup'
@@ -732,7 +741,27 @@ try {
732741
await expect(page.getByRole('navigation', { name: 'Search views' })).toHaveCount(0)
733742
})
734743
await check('Assistant history rejects a chat from another organization', async () => {
735-
await page.goto(`${baseUrl.origin}${root}/search/chat/${deniedChatId}`)
744+
const documentResponse = await page.goto(`${baseUrl.origin}${root}/search/chat/${deniedChatId}`)
745+
assert(documentResponse, 'The denied chat navigation must return a document')
746+
const html = await documentResponse.text()
747+
deniedDocument = {
748+
url: documentResponse.url(),
749+
status: documentResponse.status(),
750+
bytes: new TextEncoder().encode(html).byteLength,
751+
suspenseTemplates: (html.match(/<template\b[^>]*>/g) ?? [])
752+
.slice(0, DIAGNOSTIC_LIMITS.templates)
753+
.map((tag) => truncate(tag, DIAGNOSTIC_LIMITS.text)),
754+
suspenseMarkers: (html.match(/<!--\/?\$[^>]*-->/g) ?? [])
755+
.slice(0, DIAGNOSTIC_LIMITS.samples)
756+
.map((marker) => truncate(marker, DIAGNOSTIC_LIMITS.text)),
757+
suspenseInstructions: (html.match(/\$(?:RX|RC)\([^<]*?\)/g) ?? [])
758+
.slice(0, DIAGNOSTIC_LIMITS.templates)
759+
.map((instruction) => truncate(instruction, DIAGNOSTIC_LIMITS.text)),
760+
robots: (html.match(/<meta\b[^>]*>/g) ?? [])
761+
.filter((tag) => /name=["']robots["']/.test(tag))
762+
.slice(0, DIAGNOSTIC_LIMITS.templates)
763+
.map((tag) => truncate(tag, DIAGNOSTIC_LIMITS.text)),
764+
}
736765
await expect(page.getByRole('heading', { name: 'Page not found' })).toBeVisible()
737766
const response = await page.request.get(
738767
`${baseUrl.origin}/api/mothership/chats/${deniedChatId}`
@@ -819,6 +848,7 @@ try {
819848
browserErrorEventCount,
820849
browserErrorEvents,
821850
documentResponses,
851+
deniedDocument,
822852
artifactDirectory,
823853
},
824854
null,

0 commit comments

Comments
 (0)