Skip to content

Commit 40f14f9

Browse files
committed
chore(search): refresh permissions docs and verify receipt captures
1 parent ca659d2 commit 40f14f9

4 files changed

Lines changed: 36 additions & 20 deletions

File tree

-7.48 KB
Loading

‎apps/sim/lib/core/config/env-flags.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export const isTriggerDevEnabled = isTruthy(env.TRIGGER_DEV_ENABLED)
291291
* `NEXT_PUBLIC_ENTERPRISE_ENABLED` twin (see {@link isBillingEnabled}).
292292
* Deployments must set both together.
293293
*/
294-
export const isEnterpriseEnabled =
294+
const isEnterpriseEnabled =
295295
typeof window === 'undefined'
296296
? isTruthy(env.ENTERPRISE_ENABLED)
297297
: isTruthy(getEnv('NEXT_PUBLIC_ENTERPRISE_ENABLED'))

‎apps/sim/scripts/test-assistant-actions-e2e.ts‎

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict'
22
import { mkdir, writeFile } from 'node:fs/promises'
33
import { dirname, resolve } from 'node:path'
4-
import { chromium, expect } from '@playwright/test'
4+
import { chromium, expect, type Locator } from '@playwright/test'
55
import { assertDisposableTestDatabaseUrl } from '@sim/db/testing/test-infrastructure'
66
import { createLogger } from '@sim/logger'
77
import { createDeferred } from '@sim/testing/helpers/deferred'
@@ -188,6 +188,16 @@ async function capture(name: string) {
188188
await page.screenshot({ path: resolve(artifactDirectory, `${name}.png`), animations: 'disabled' })
189189
}
190190

191+
async function captureExpandedReceipt(name: string, disclosure: Locator) {
192+
await disclosure.hover()
193+
await page.mouse.wheel(0, -1000)
194+
await disclosure.click()
195+
await expect(disclosure).toHaveAttribute('aria-expanded', 'true')
196+
await expect(disclosure).toBeInViewport({ ratio: 1 })
197+
await capture(name)
198+
await expect(disclosure).toBeInViewport({ ratio: 1 })
199+
}
200+
191201
function proposalArguments(summary: string) {
192202
return {
193203
credential: credentialId,
@@ -1042,10 +1052,12 @@ try {
10421052
const historicalReceipt = page
10431053
.getByRole('region', { name: 'Create Jira issue receipt' })
10441054
.filter({ hasText: 'Approved historical title' })
1045-
await historicalReceipt
1046-
.getByRole('button', { name: 'View Create Jira issue receipt: Completed', exact: true })
1047-
.click()
1048-
await capture('action-receipt-completed-expanded')
1055+
await captureExpandedReceipt(
1056+
'action-receipt-completed-expanded',
1057+
historicalReceipt.getByRole('button', {
1058+
name: /^(View|Hide) Create Jira issue receipt: Completed$/,
1059+
})
1060+
)
10491061
await historicalReceipt
10501062
.getByRole('button', { name: 'Hide Create Jira issue receipt: Completed', exact: true })
10511063
.click()
@@ -1633,7 +1645,15 @@ try {
16331645
await expect(
16341646
page.getByText('Could not load action history', { exact: true })
16351647
).toHaveCount(index + 1, { timeout: 15_000 })
1648+
const historyError = page
1649+
.getByText('Could not load action history', { exact: true })
1650+
.last()
1651+
await historyError.hover()
1652+
await page.mouse.wheel(0, -1000)
1653+
await historyError.scrollIntoViewIfNeeded()
1654+
await expect(historyError).toBeInViewport({ ratio: 1 })
16361655
await capture(`receipt-history-${fixture.state.toLowerCase()}-retry`)
1656+
await expect(historyError).toBeInViewport({ ratio: 1 })
16371657
} finally {
16381658
await page.unroute(`${receiptsUrl}*`)
16391659
}
@@ -1660,13 +1680,12 @@ try {
16601680
const receipt = page
16611681
.getByRole('region', { name: 'Create Jira issue receipt' })
16621682
.filter({ hasText: 'Batch issue 62' })
1663-
await receipt
1664-
.getByRole('button', {
1665-
name: `View Create Jira issue receipt: ${fixture.label}`,
1666-
exact: true,
1683+
await captureExpandedReceipt(
1684+
`action-receipt-${fixture.label.toLowerCase().replaceAll(' ', '-')}`,
1685+
receipt.getByRole('button', {
1686+
name: new RegExp(`^(View|Hide) Create Jira issue receipt: ${fixture.label}$`),
16671687
})
1668-
.click()
1669-
await capture(`action-receipt-${fixture.label.toLowerCase().replaceAll(' ', '-')}`)
1688+
)
16701689
}
16711690
const incompatibleBinding = {
16721691
...toRecord(savedExecution.assistant_action),
@@ -1681,13 +1700,12 @@ try {
16811700
]) {
16821701
await sql`update copilot_async_tool_calls set assistant_action = ${sql.json(fixture.binding)} where run_id = ${bulkRunId} and tool_call_id = ${precedingCallId}`
16831702
await page.reload()
1684-
await page
1685-
.getByRole('button', {
1686-
name: 'View Create Jira issue receipt: Outcome unknown',
1687-
exact: true,
1703+
await captureExpandedReceipt(
1704+
`action-receipt-${fixture.name}`,
1705+
page.getByRole('button', {
1706+
name: /^(View|Hide) Create Jira issue receipt: Outcome unknown$/,
16881707
})
1689-
.click()
1690-
await capture(`action-receipt-${fixture.name}`)
1708+
)
16911709
}
16921710
} finally {
16931711
await sql`update copilot_async_tool_calls set status = ${savedExecution.status}, execution_started_at = ${savedExecution.execution_started_at}, execution_settled_at = ${savedExecution.execution_settled_at}, execution_owner_token = ${savedExecution.execution_owner_token}, execution_lease_expires_at = ${savedExecution.execution_lease_expires_at}, completed_at = ${savedExecution.completed_at}, result = ${savedExecution.result === null ? null : sql.json(savedExecution.result)}, assistant_action = ${sql.json(savedExecution.assistant_action)} where run_id = ${bulkRunId} and tool_call_id = ${precedingCallId}`

‎packages/testing/src/mocks/env-flags.mock.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ interface EnvFlagsMockState {
2828
isAppConfigEnabled: boolean
2929
isSlackExtendedScopesEnabled: boolean
3030
isTriggerDevEnabled: boolean
31-
isEnterpriseEnabled: boolean
3231
isSsoEnabled: boolean
3332
isUsageMonitoringEnabled: boolean
3433
isAccessControlEnabled: boolean
@@ -82,7 +81,6 @@ const defaultEnvFlagsState: EnvFlagsMockState = {
8281
isAppConfigEnabled: false,
8382
isSlackExtendedScopesEnabled: false,
8483
isTriggerDevEnabled: false,
85-
isEnterpriseEnabled: false,
8684
isSsoEnabled: false,
8785
/** OAuth-aware route behavior is available unless a suite overrides it. */
8886
isUsageMonitoringEnabled: false,

0 commit comments

Comments
 (0)