Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(control-ui): align grant and provider assertions

Alfredo Lopez1f5607b36d91
diff --git a/control-ui/components/__tests__/GfsBrowser.test.tsx b/control-ui/components/__tests__/GfsBrowser.test.tsx
index 12e6ca5a7..1fd5e2b72 100644
--- a/control-ui/components/__tests__/GfsBrowser.test.tsx
+++ b/control-ui/components/__tests__/GfsBrowser.test.tsx
@@ -69,6 +69,12 @@ function selectPermission(label: string) {
fireEvent.click(screen.getByRole('menuitemcheckbox', { name: label }))
}
+async function confirmGrantAccess() {
+ const dialog = await screen.findByRole('alertdialog', { name: 'Grant access?' })
+ fireEvent.click(within(dialog).getByRole('button', { name: 'Grant access' }))
+ await waitFor(() => expect(screen.queryByRole('alertdialog')).toBeNull())
+}
+
async function openResourceMenu(resourceName: string) {
fireEvent.click(await screen.findByRole('button', { name: `Actions for ${resourceName}` }))
}
@@ -702,7 +708,7 @@ describe('GfsBrowser', () => {
fireEvent.click(await screen.findByRole('option', { name: 'Ada Lovelace' }))
selectPermission('Read')
fireEvent.click(screen.getByRole('button', { name: 'Grant access' }))
- expect(screen.queryByRole('alertdialog')).toBeNull()
+ await confirmGrantAccess()
await waitFor(() =>
expect(mockPutGfsGrant).toHaveBeenCalledWith({
@@ -748,6 +754,7 @@ describe('GfsBrowser', () => {
fireEvent.click(await screen.findByRole('option', { name: 'Ada Lovelace' }))
selectPermission('Read')
fireEvent.click(screen.getByRole('button', { name: 'Grant access' }))
+ await confirmGrantAccess()
await waitFor(() =>
expect(mockPutGfsGrant).toHaveBeenCalledWith(
@@ -774,6 +781,7 @@ describe('GfsBrowser', () => {
fireEvent.click(await screen.findByRole('option', { name: 'Research' }))
selectPermission('Read')
fireEvent.click(screen.getByRole('button', { name: 'Grant access' }))
+ await confirmGrantAccess()
await waitFor(() =>
expect(mockPutGfsGrant).toHaveBeenCalledWith(
@@ -787,6 +795,7 @@ describe('GfsBrowser', () => {
fireEvent.click(await screen.findByRole('option', { name: 'Operator' }))
selectPermission('Read')
fireEvent.click(screen.getByRole('button', { name: 'Grant access' }))
+ await confirmGrantAccess()
await waitFor(() =>
expect(mockPutGfsGrant).toHaveBeenLastCalledWith(
@@ -811,6 +820,7 @@ describe('GfsBrowser', () => {
fireEvent.click(await screen.findByRole('option', { name: 'Ada Lovelace' }))
selectPermission('Write')
fireEvent.click(screen.getByRole('button', { name: 'Grant access' }))
+ await confirmGrantAccess()
expect((await screen.findByText('escalation_rejected')).getAttribute('role')).toBe('alert')
})
diff --git a/control-ui/components/__tests__/LlmModelTable.test.tsx b/control-ui/components/__tests__/LlmModelTable.test.tsx
index 9dbafa7c4..3cda29933 100644
--- a/control-ui/components/__tests__/LlmModelTable.test.tsx
+++ b/control-ui/components/__tests__/LlmModelTable.test.tsx
@@ -204,7 +204,7 @@ describe('LlmModelTable filters', () => {
})
expect(screen.queryByText('No models match this filter.')).toBeNull()
expect(screen.getByRole('button', { name: 'Expand Anthropic models' })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'Expand Google models' })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Expand google models' })).toBeInTheDocument()
})
it('shows the filtered empty state when no row matches', () => {