Skip to content

Commit d5aac31

Browse files
committed
test(platform): confirm Revoke invite through its dialog and drop the withdrawn Assistant New chat check
1 parent 20469a5 commit d5aac31

2 files changed

Lines changed: 23 additions & 18 deletions

File tree

‎apps/sim/platform/checks/live/flows.spec.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ test('a pending invite resends and revokes from its row', async ({ page }) => {
149149
await expect(page.getByRole('menuitem', { name: 'Resend invite' })).toHaveCount(0)
150150
await row.getByRole('button', { name: /^Actions for/ }).click()
151151
await page.getByRole('menuitem', { name: 'Revoke invite' }).click()
152+
const confirm = page.getByRole('dialog', { name: 'Revoke invite' })
153+
await expect(confirm).toContainText(email)
154+
const [revoked] = await Promise.all([
155+
page.waitForResponse(
156+
(candidate) =>
157+
candidate.request().method() === 'DELETE' &&
158+
/^\/api\/invitations\/[^/]+$/.test(new URL(candidate.url()).pathname)
159+
),
160+
confirm.getByRole('button', { name: 'Revoke', exact: true }).click(),
161+
])
162+
expect(revoked.ok(), 'Revoke invite was refused').toBe(true)
163+
await expect(confirm).toBeHidden()
152164
await expect(page.getByText(email)).toHaveCount(0)
153165
await page.reload()
154166
await expect(page.getByRole('heading', { name: 'Members', level: 1 })).toBeVisible()

‎apps/sim/scripts/org-redesign-e2e/checks/chat.ts‎

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,17 @@ export async function chatChecks() {
9292
}
9393
}
9494
)
95-
await check(
96-
'assistant conversation under Search: switch, New chat, follow-up composer',
97-
async () => {
98-
await withSession(MEMBER, async ({ page }) => {
99-
await page.goto(url(org.searchChat(MEMBER_CHATS.assistant.id)))
100-
await expect(modeRadio(page, 'Assistant')).toBeChecked()
101-
await expect(composer(page)).toHaveAttribute('placeholder', 'Ask a follow-up…')
102-
// The Assistant takes images only: its attach button says so, and it offers no skills.
103-
await expect(page.getByRole('button', { name: 'Attach image', exact: true })).toBeVisible()
104-
await expect(page.getByRole('button', { name: 'Attach file', exact: true })).toHaveCount(0)
105-
await expect(page.getByRole('button', { name: 'Skills', exact: true })).toHaveCount(0)
106-
const newChat = page.getByRole('button', { name: 'New chat', exact: true })
107-
await expect(newChat).toBeVisible()
108-
await newChat.click()
109-
await expect(page).toHaveURL(assistantUrl())
110-
})
111-
}
112-
)
95+
await check('assistant conversation under Search: switch, follow-up composer', async () => {
96+
await withSession(MEMBER, async ({ page }) => {
97+
await page.goto(url(org.searchChat(MEMBER_CHATS.assistant.id)))
98+
await expect(modeRadio(page, 'Assistant')).toBeChecked()
99+
await expect(composer(page)).toHaveAttribute('placeholder', 'Ask a follow-up…')
100+
// The Assistant takes images only: its attach button says so, and it offers no skills.
101+
await expect(page.getByRole('button', { name: 'Attach image', exact: true })).toBeVisible()
102+
await expect(page.getByRole('button', { name: 'Attach file', exact: true })).toHaveCount(0)
103+
await expect(page.getByRole('button', { name: 'Skills', exact: true })).toHaveCount(0)
104+
})
105+
})
113106
await check(
114107
'a stream survives switching to the Search view: Assistant stays mounted, inert',
115108
async () => {

0 commit comments

Comments
 (0)