test: bring stale tests and lint in line with the current UI
- CodeDeploy: query the redesigned form's labels. - CloudFormation: expect the parameters and capabilities fields the form now submits. - ALB listeners: advance the five-second minimum create state before deleting, since row actions are disabled while it is pending. - Lightsail: cast the fetch mock as a whole so it type-checks. - TargetGroupPanel: depend on the stable refetch function to satisfy react-hooks/exhaustive-deps.
This commit is contained in:
@@ -9,12 +9,12 @@ describe('CodeDeployCreatePanel', () => {
|
||||
const onSubmit = vi.fn()
|
||||
render(<CodeDeployCreatePanel isSubmitting={false} submitError={null} onCancel={vi.fn()} onSubmit={onSubmit}/>)
|
||||
|
||||
await user.type(screen.getByLabelText('Application name'), 'orders')
|
||||
await user.type(screen.getByLabelText('Deployment group name'), 'production')
|
||||
await user.type(screen.getByLabelText('CodeDeploy service role ARN'), 'role-arn')
|
||||
await user.type(screen.getByLabelText(/^Application name/), 'orders')
|
||||
await user.type(screen.getByLabelText(/^Deployment group name/), 'production')
|
||||
await user.type(screen.getByLabelText(/^Service role ARN/), 'role-arn')
|
||||
await user.click(screen.getByRole('button', {name: 'Create deployment group'}))
|
||||
|
||||
expect(screen.queryByLabelText('ECS cluster name')).not.toBeInTheDocument()
|
||||
expect(screen.queryByLabelText(/^Cluster name/)).not.toBeInTheDocument()
|
||||
expect(onSubmit).toHaveBeenCalledWith({applicationName: 'orders', deploymentGroupName: 'production', computePlatform: 'Lambda', serviceRoleArn: 'role-arn', deploymentConfig: 'AllAtOnce', rollbackOnFailure: true})
|
||||
})
|
||||
|
||||
@@ -24,16 +24,16 @@ describe('CodeDeployCreatePanel', () => {
|
||||
render(<CodeDeployCreatePanel isSubmitting={false} submitError={null} onCancel={vi.fn()} onSubmit={onSubmit}/>)
|
||||
|
||||
await user.selectOptions(screen.getByLabelText('Compute platform'), 'ECS')
|
||||
await user.type(screen.getByLabelText('Application name'), 'orders')
|
||||
await user.type(screen.getByLabelText('Deployment group name'), 'production')
|
||||
await user.type(screen.getByLabelText('CodeDeploy service role ARN'), 'role-arn')
|
||||
await user.type(screen.getByLabelText('ECS cluster name'), 'orders-cluster')
|
||||
await user.type(screen.getByLabelText('ECS service name'), 'orders-service')
|
||||
await user.type(screen.getByLabelText('Blue target group name'), 'orders-blue')
|
||||
await user.type(screen.getByLabelText('Green target group name'), 'orders-green')
|
||||
await user.type(screen.getByLabelText('Production listener ARN'), 'listener-arn')
|
||||
await user.type(screen.getByLabelText(/^Application name/), 'orders')
|
||||
await user.type(screen.getByLabelText(/^Deployment group name/), 'production')
|
||||
await user.type(screen.getByLabelText(/^Service role ARN/), 'role-arn')
|
||||
await user.type(screen.getByLabelText(/^Cluster name/), 'orders-cluster')
|
||||
await user.type(screen.getByLabelText(/^Service name/), 'orders-service')
|
||||
await user.type(screen.getByLabelText(/Current production target group/), 'orders-blue')
|
||||
await user.type(screen.getByLabelText(/Replacement target group/), 'orders-green')
|
||||
await user.type(screen.getByLabelText(/^Production listener ARN/), 'listener-arn')
|
||||
await user.selectOptions(screen.getByLabelText('Traffic configuration'), 'Linear10PercentEvery3Minutes')
|
||||
await user.click(screen.getByLabelText('Roll back automatically on deployment failure'))
|
||||
await user.click(screen.getByLabelText(/Automatic rollback/))
|
||||
await user.click(screen.getByRole('button', {name: 'Create deployment group'}))
|
||||
|
||||
expect(onSubmit).toHaveBeenCalledWith({applicationName: 'orders', deploymentGroupName: 'production', computePlatform: 'ECS', serviceRoleArn: 'role-arn', clusterName: 'orders-cluster', serviceName: 'orders-service', blueTargetGroupName: 'orders-blue', greenTargetGroupName: 'orders-green', productionListenerArn: 'listener-arn', deploymentConfig: 'Linear10PercentEvery3Minutes', rollbackOnFailure: false})
|
||||
|
||||
Reference in New Issue
Block a user