feat: Step Function + small fixes + more services + color matching the services
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {QueryClient, QueryClientProvider} from '@tanstack/react-query'
|
||||
import {fireEvent, render, screen, waitFor} from '@testing-library/react'
|
||||
import {fireEvent, render, screen, waitFor, within} from '@testing-library/react'
|
||||
import userEvent from '@testing-library/user-event'
|
||||
import {afterEach, describe, expect, test, vi} from 'vitest'
|
||||
import {WorkflowExecutionDebugger} from '@/components/WorkflowExecutionDebugger'
|
||||
@@ -45,9 +45,24 @@ describe('WorkflowExecutionDebugger', () => {
|
||||
expect(screen.queryByRole('button', {name: 'Load more history'})).not.toBeInTheDocument()
|
||||
fireEvent.change(screen.getByLabelText('JSON input'), {target: {value: '{"orderId":"1"}'}})
|
||||
await user.click(screen.getByRole('button', {name: 'Start execution'}))
|
||||
expect(screen.getByRole('alertdialog')).toHaveTextContent('{"orderId":"1"}')
|
||||
await user.click(within(screen.getByRole('alertdialog')).getByRole('button', {name: 'Start execution'}))
|
||||
await waitFor(() => expect(startWorkflowExecution).toHaveBeenCalledWith(machine.id, {input: '{"orderId":"1"}'}))
|
||||
})
|
||||
|
||||
test('does not start until the inline confirmation is accepted', async () => {
|
||||
vi.mocked(listWorkflowExecutions).mockResolvedValue([])
|
||||
const user = userEvent.setup()
|
||||
renderPanel()
|
||||
|
||||
await user.click(screen.getByRole('button', {name: 'Start execution'}))
|
||||
expect(screen.getByRole('alertdialog')).toHaveTextContent('may invoke an unavailable Lambda')
|
||||
expect(startWorkflowExecution).not.toHaveBeenCalled()
|
||||
await user.click(screen.getByRole('button', {name: 'Cancel'}))
|
||||
expect(screen.queryByRole('alertdialog')).not.toBeInTheDocument()
|
||||
expect(startWorkflowExecution).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test('confirms stopping only a running execution', async () => {
|
||||
vi.stubGlobal('confirm', vi.fn(() => true))
|
||||
vi.mocked(listWorkflowExecutions).mockResolvedValue([{executionArn, name: 'run-1', status: 'RUNNING', startDate: '2026-07-28T10:01:00.000Z'}])
|
||||
|
||||
Reference in New Issue
Block a user