@spinnaker/amazon 2026.3.2 → 2026.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/AwsModalFooter.d.ts +1 -1
- package/dist/deploymentStrategy/AdditionalFields.d.ts +1 -1
- package/dist/function/CreateLambdaFunction.d.ts +1 -1
- package/dist/function/configure/ExecutionRole.d.ts +1 -1
- package/dist/function/configure/FunctionBasicInformation.d.ts +1 -1
- package/dist/function/configure/FunctionDebugAndErrorHandling.d.ts +1 -1
- package/dist/function/configure/FunctionEnvironmentVariables.d.ts +1 -1
- package/dist/function/configure/FunctionSettings.d.ts +1 -1
- package/dist/function/configure/FunctionTags.d.ts +1 -1
- package/dist/function/configure/Network.d.ts +1 -1
- package/dist/function/details/AmazonFunctionDetails.d.ts +1 -1
- package/dist/function/details/FunctionActions.d.ts +1 -1
- package/dist/index.js +279 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/details/AmazonInstanceInformation.d.ts +2 -2
- package/dist/instance/details/CostFactor.d.ts +2 -2
- package/dist/instance/details/InstanceDns.d.ts +2 -2
- package/dist/instance/details/InstanceInformation.d.ts +2 -2
- package/dist/instance/details/InstanceSecurityGroups.d.ts +2 -2
- package/dist/instance/details/InstanceStatus.d.ts +2 -2
- package/dist/instance/details/InstanceTags.d.ts +2 -2
- package/dist/loadBalancer/configure/AmazonLoadBalancerChoiceModal.d.ts +1 -1
- package/dist/loadBalancer/configure/application/ALBListeners.d.ts +1 -1
- package/dist/loadBalancer/configure/application/ConfigureOidcConfigModal.d.ts +1 -1
- package/dist/loadBalancer/configure/application/ConfigureRedirectConfigModal.d.ts +1 -1
- package/dist/loadBalancer/configure/application/CreateApplicationLoadBalancer.d.ts +1 -1
- package/dist/loadBalancer/configure/application/TargetGroups.d.ts +1 -1
- package/dist/loadBalancer/configure/classic/AdvancedSettings.d.ts +1 -1
- package/dist/loadBalancer/configure/classic/HealthCheck.d.ts +1 -1
- package/dist/loadBalancer/configure/classic/Listeners.d.ts +1 -1
- package/dist/loadBalancer/configure/common/AmazonCertificateSelectField.d.ts +1 -1
- package/dist/loadBalancer/configure/common/LoadBalancerLocation.d.ts +1 -1
- package/dist/loadBalancer/configure/common/SecurityGroups.d.ts +1 -1
- package/dist/loadBalancer/configure/network/CertificateSelectors.d.ts +2 -2
- package/dist/loadBalancer/configure/network/NLBListeners.d.ts +1 -1
- package/dist/loadBalancer/configure/network/TargetGroups.d.ts +1 -1
- package/dist/loadBalancer/details/LoadBalancerActions.d.ts +1 -1
- package/dist/pipeline/stages/AmazonStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/bake/AwsBakeStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/cloneServerGroup/AwsCloneServerGroupStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/deleteLambda/DeleteLambdaFunctionStageForm.d.ts +2 -2
- package/dist/pipeline/stages/deleteLambda/LambdaDeleteStage.d.ts +2 -2
- package/dist/pipeline/stages/deleteLambda/constants/deleteVersion.picker.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.d.ts +2 -2
- package/dist/pipeline/stages/deployCloudFormation/DeployCloudFormationStackStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationExecutionDetails.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionApproval.d.ts +2 -2
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionDetails.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionLabel.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionMarkerIcon.d.ts +1 -1
- package/dist/pipeline/stages/deployLambda/components/AwsLambdaFunctionStageForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/components/BasicSettingsForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/components/EnvironmentForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/components/ExecutionRoleForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/components/LambdaAtEdgeForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/components/NetworkForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/components/TriggerEventsForm.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/config/LambdaDeploymentStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/deployLambda/config/LambdaDeploymentStageExecutionDetails.d.ts +2 -2
- package/dist/pipeline/stages/disableAsg/AwsDisableAsgStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/disableCluster/AwsDisableClusterStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/enableAsg/AwsEnableAsgStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/invokeLambda/InvokeLambdaFunctionStageForm.d.ts +2 -2
- package/dist/pipeline/stages/invokeLambda/LambdaInvokeStage.d.ts +2 -2
- package/dist/pipeline/stages/invokeLambda/components/InvokeLambdaOperation.d.ts +2 -2
- package/dist/pipeline/stages/modifyScalingProcess/ModifyScalingProcessStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/modifyWarmPool/ModifyWarmPoolStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/rollbackCluster/AwsRollbackClusterStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/LambdaRouteStage.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/RouteLambdaFunctionStageForm.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/TriggerEventsForm.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/BlueGreenDeploymentForm.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/HealthCheckStrategy.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/BlueGreenDeployment/InvocationHealthCheck.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/DeploymentStrategyForm.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/RenderStrategy.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/SimpleDeploymentForm.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/components/VersionPicker.d.ts +1 -1
- package/dist/pipeline/stages/routeLambda/components/WeightedDeploymentForm.d.ts +2 -2
- package/dist/pipeline/stages/routeLambda/constants/strategy.picker.d.ts +1 -1
- package/dist/pipeline/stages/scaleDownCluster/AwsScaleDownClusterStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/shrinkCluster/AwsShrinkClusterStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/tagImage/awsTagImageStage.d.ts +2 -2
- package/dist/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStageConfig.d.ts +2 -2
- package/dist/pipeline/stages/updateCodeLambda/LambdaUpdateCodeStageExecutionDetails.d.ts +2 -2
- package/dist/pipeline/stages/updateCodeLambda/components/UpdateCodeStageForm.d.ts +2 -2
- package/dist/securityGroup/details/IPRangeRules.d.ts +1 -1
- package/dist/serverGroup/configure/AmazonImageSelectInput.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/AmazonCloneServerGroupModal.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/ServerGroupTemplateSelection.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/capacity/CapacitySelector.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/capacity/MinMaxDesired.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/instanceType/CpuCreditsToggle.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/InstanceTypeSelector.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/InstanceTypeWarning.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/AdvancedModeSelector.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/AmazonInstanceTypeInfoRenderer.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstanceProfileSelector.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstanceTypeRow.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstanceTypeSelect.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstanceTypeTable.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstanceTypeTableBody.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstanceTypeTableParts.d.ts +4 -4
- package/dist/serverGroup/configure/wizard/instanceType/advancedMode/InstancesDistribution.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/instanceType/simpleMode/SimpleModeSelector.d.ts +2 -2
- package/dist/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/ServerGroupCapacity.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/ServerGroupInstanceType.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/ServerGroupSecurityGroups.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/ServerGroupZones.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettings.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsInner.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.d.ts +1 -1
- package/dist/serverGroup/configure/wizard/securityGroups/ServerGroupSecurityGroupsRemoved.d.ts +1 -1
- package/dist/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.d.ts +2 -1
- package/dist/serverGroup/details/resize/AmazonResizeServerGroupModal.d.ts +1 -1
- package/dist/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.d.ts +1 -1
- package/dist/serverGroup/details/scalingPolicy/ScalingPolicySummary.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/StepPolicySummary.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/chart/DateLineChart.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/chart/MetricAlarmChart.d.ts +3 -3
- package/dist/serverGroup/details/scalingPolicy/popover/AlarmSummary.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/popover/StepPolicyPopoverContent.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetMetricFields.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingAdditionalSettings.d.ts +2 -3
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingChart.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingSummary.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/targetTracking/UpsertTargetTrackingModal.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/PolicyTypeSelectionModal.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/ScalingPolicyAdditionalSettings.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/UpsertScalingPolicyModal.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/AlarmConfigurer.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/MetricSelector.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/simple/SimplePolicyAction.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/step/StepPolicyAction.d.ts +2 -2
- package/dist/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.d.ts +1 -1
- package/dist/serverGroup/details/scheduledAction/ScheduledAction.d.ts +1 -1
- package/dist/serverGroup/details/scheduledActions/EditScheduledActionsModal.d.ts +1 -1
- package/dist/serverGroup/details/sections/InstancesDistributionDetailsSection.d.ts +2 -2
- package/dist/serverGroup/details/sections/LaunchTemplateDetailsSection.d.ts +2 -2
- package/dist/serverGroup/details/sections/MultipleInstanceTypesSubSection.d.ts +2 -2
- package/dist/serverGroup/details/securityGroups/EditSecurityGroupsModal.d.ts +1 -1
- package/dist/serverGroup/details/warmPool/ModifyWarmPoolModal.d.ts +1 -1
- package/dist/subnet/SubnetSelectField.d.ts +1 -1
- package/dist/subnet/SubnetSelectInput.d.ts +1 -1
- package/dist/vpc/VpcTag.d.ts +2 -2
- package/package.json +5 -7
- package/src/aws.module.spec.ts +20 -21
- package/src/function/details/AmazonFunctionDetails.tsx +1 -1
- package/src/function/details/FunctionActions.spec.tsx +56 -36
- package/src/instance/awsInstanceType.service.spec.js +24 -22
- package/src/instance/details/AmazonInstanceDetails.spec.tsx +7 -7
- package/src/instance/details/InstanceInformation.spec.tsx +44 -24
- package/src/loadBalancer/AmazonLoadBalancersTag.spec.tsx +1 -1
- package/src/loadBalancer/TargetGroupDetails.spec.tsx +5 -5
- package/src/loadBalancer/configure/application/TargetGroups.tsx +1 -1
- package/src/loadBalancer/configure/common/SecurityGroups.spec.tsx +4 -4
- package/src/loadBalancer/configure/network/TargetGroups.tsx +1 -1
- package/src/loadBalancer/details/amazonLoadBalancerDetails.spec.tsx +31 -53
- package/src/pipeline/stages/AmazonStageConfig.spec.tsx +37 -46
- package/src/pipeline/stages/deployCloudFormation/DeployCloudFormationStackStageConfig.tsx +1 -0
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.spec.tsx +316 -279
- package/src/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.spec.tsx +70 -90
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.spec.tsx +198 -130
- package/src/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.spec.tsx +49 -40
- package/src/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.spec.tsx +341 -427
- package/src/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.tsx +7 -0
- package/src/pipeline/stages/tagImage/awsTagImageStage.spec.tsx +62 -107
- package/src/routerConsumers.spec.tsx +23 -23
- package/src/securityGroup/configure/AmazonSecurityGroupModal.spec.tsx +38 -47
- package/src/securityGroup/details/AmazonSecurityGroupDetails.spec.tsx +7 -6
- package/src/serverGroup/configure/AmazonImageSelectInput.spec.tsx +47 -65
- package/src/serverGroup/configure/AmazonImageSelectInput.tsx +1 -1
- package/src/serverGroup/configure/serverGroupCommandBuilder.aws.service.spec.js +18 -19
- package/src/serverGroup/configure/serverGroupCommandBuilder.spec.js +41 -26
- package/src/serverGroup/configure/wizard/instanceType/simpleMode/SimpleModeSelector.spec.tsx +52 -75
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.spec.tsx +1 -1
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.spec.tsx +36 -33
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.tsx +7 -1
- package/src/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.spec.tsx +2 -2
- package/src/serverGroup/details/AmazonServerGroupActions.spec.tsx +79 -67
- package/src/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.spec.tsx +78 -66
- package/src/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.tsx +23 -6
- package/src/serverGroup/details/rollback/AmazonRollbackServerGroupModal.spec.tsx +86 -94
- package/src/serverGroup/details/rollback/AmazonRollbackServerGroupModal.tsx +3 -0
- package/src/serverGroup/details/scalingPolicy/targetTracking/TargetTrackingAdditionalSettings.tsx +1 -39
- package/src/serverGroup/details/scalingPolicy/targetTracking/UpsertTargetTrackingModal.tsx +0 -1
- package/src/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.spec.tsx +5 -5
- package/src/serverGroup/details/scheduledActions/EditScheduledActionsModal.spec.tsx +8 -8
- package/src/serverGroup/details/sections/AmazonServerGroupMaintenanceActions.spec.tsx +71 -60
- package/src/serverGroup/details/sections/InstancesDistributionDetailsSection.spec.tsx +21 -39
- package/src/serverGroup/details/sections/LaunchTemplateDetailsSection.spec.tsx +56 -97
- package/src/serverGroup/details/securityGroups/EditSecurityGroupsModal.spec.tsx +48 -77
- package/src/serverGroup/details/warmPool/ModifyWarmPoolModal.spec.tsx +5 -5
- package/src/vpc/VpcReader.spec.ts +1 -1
- package/src/vpc/VpcTag.spec.tsx +11 -15
- /package/dist/{amazon.logo352d4e042476837f.svg → amazon.logoBzC5E-3F.svg} +0 -0
|
@@ -1,122 +1,102 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fireEvent, render, screen, waitFor, within } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import { BakeryReader
|
|
4
|
+
import { BakeryReader } from '@spinnaker/core';
|
|
5
|
+
import { getFormGroupByLabel } from '../../../../../core/src/utils/testUtils/rtl';
|
|
5
6
|
|
|
6
7
|
import { AmazonStageConfig } from '../AmazonStageConfig';
|
|
7
8
|
import { AwsFindImageFromTagsStageConfig } from './AwsFindImageFromTagsStageConfig';
|
|
8
9
|
import { awsFindImageFromTagsStage } from './awsFindImageFromTagsStage';
|
|
9
10
|
|
|
10
11
|
describe('AWS Find Image from Tags stage', () => {
|
|
11
|
-
function renderEditor(
|
|
12
|
-
const updateStageField =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
function renderEditor(initialStage: any) {
|
|
13
|
+
const updateStageField = vi.fn();
|
|
14
|
+
function StageHarness() {
|
|
15
|
+
const [stage, setStage] = React.useState(initialStage);
|
|
16
|
+
const update = (changes: any) => {
|
|
17
|
+
updateStageField(changes);
|
|
18
|
+
setStage((current: any) => ({ ...current, ...changes }));
|
|
19
|
+
};
|
|
20
|
+
return (
|
|
21
|
+
<AwsFindImageFromTagsStageConfig
|
|
22
|
+
application={{ defaultRegions: { aws: 'eu-west-1' } } as any}
|
|
23
|
+
pipeline={{} as any}
|
|
24
|
+
stage={stage}
|
|
25
|
+
updateStageField={update}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return { updateStageField, ...render(<StageHarness />) };
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
it('registers a dedicated stage editor', () => {
|
|
25
33
|
expect(awsFindImageFromTagsStage.component).not.toBe(AmazonStageConfig);
|
|
26
34
|
});
|
|
27
35
|
|
|
28
|
-
it('renders explicit persisted values without changing them on mount', () => {
|
|
29
|
-
spyOn(BakeryReader, 'getRegions').
|
|
30
|
-
const
|
|
31
|
-
const updateStageField = jasmine.createSpy('updateStageField');
|
|
32
|
-
const wrapper = mount(
|
|
33
|
-
<AwsFindImageFromTagsStageConfig
|
|
34
|
-
application={{ defaultRegions: { aws: 'eu-west-1' } } as any}
|
|
35
|
-
pipeline={{} as any}
|
|
36
|
-
stage={{ cloudProvider: '', packageName: 'payments', regions: [], tags }}
|
|
37
|
-
updateStageField={updateStageField}
|
|
38
|
-
/>,
|
|
39
|
-
);
|
|
36
|
+
it('renders explicit persisted values without changing them on mount', async () => {
|
|
37
|
+
vi.spyOn(BakeryReader, 'getRegions').mockResolvedValue([] as any);
|
|
38
|
+
const rendered = renderEditor({ cloudProvider: '', packageName: 'payments', regions: [], tags: { Owner: '' } });
|
|
40
39
|
|
|
41
|
-
expect(
|
|
42
|
-
expect(
|
|
43
|
-
expect(
|
|
44
|
-
expect(
|
|
45
|
-
expect(updateStageField).not.toHaveBeenCalled();
|
|
46
|
-
wrapper.unmount();
|
|
40
|
+
expect(within(getFormGroupByLabel('Package')).getByRole('textbox')).toHaveValue('payments');
|
|
41
|
+
expect(within(getFormGroupByLabel('Tags')).getByLabelText('Key')).toHaveValue('Owner');
|
|
42
|
+
await waitFor(() => expect(BakeryReader.getRegions).toHaveBeenCalledWith('aws'));
|
|
43
|
+
expect(rendered.updateStageField).not.toHaveBeenCalled();
|
|
47
44
|
});
|
|
48
45
|
|
|
49
|
-
it('defaults only undefined stage fields on mount', () => {
|
|
50
|
-
spyOn(BakeryReader, 'getRegions').
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const wrapper = mount(
|
|
54
|
-
<AwsFindImageFromTagsStageConfig
|
|
55
|
-
application={{ defaultRegions: { aws: 'eu-west-1' } } as any}
|
|
56
|
-
pipeline={{} as any}
|
|
57
|
-
stage={{ cloudProvider: undefined, regions: undefined, tags: undefined }}
|
|
58
|
-
updateStageField={updateStageField}
|
|
59
|
-
/>,
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
expect(updateStageField).toHaveBeenCalledOnceWith({ cloudProvider: 'aws', regions: ['eu-west-1'], tags: {} });
|
|
63
|
-
wrapper.unmount();
|
|
64
|
-
});
|
|
46
|
+
it('defaults only undefined stage fields on mount', async () => {
|
|
47
|
+
vi.spyOn(BakeryReader, 'getRegions').mockResolvedValue([] as any);
|
|
48
|
+
const rendered = renderEditor({ cloudProvider: undefined, regions: undefined, tags: undefined });
|
|
65
49
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
pipeline={{} as any}
|
|
73
|
-
stage={{ cloudProvider: 'aws', packageName: 'payments', regions: ['persisted-region'], tags: {} }}
|
|
74
|
-
updateStageField={updateStageField}
|
|
75
|
-
/>,
|
|
50
|
+
await waitFor(() =>
|
|
51
|
+
expect(rendered.updateStageField).toHaveBeenCalledExactlyOnceWith({
|
|
52
|
+
cloudProvider: 'aws',
|
|
53
|
+
regions: ['eu-west-1'],
|
|
54
|
+
tags: {},
|
|
55
|
+
}),
|
|
76
56
|
);
|
|
77
|
-
|
|
78
|
-
await Promise.resolve();
|
|
79
|
-
await Promise.resolve();
|
|
80
|
-
wrapper.update();
|
|
81
|
-
|
|
82
|
-
expect(BakeryReader.getRegions).toHaveBeenCalledWith('aws');
|
|
83
|
-
expect(wrapper.find(ChecklistInput).prop('stringOptions')).toEqual(['persisted-region', 'eu-west-1', 'us-east-1']);
|
|
84
|
-
expect(updateStageField).not.toHaveBeenCalled();
|
|
85
|
-
wrapper.unmount();
|
|
86
57
|
});
|
|
87
58
|
|
|
88
|
-
it('
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
59
|
+
it('loads AWS regions while retaining persisted selections as options', async () => {
|
|
60
|
+
vi.spyOn(BakeryReader, 'getRegions').mockResolvedValue(['eu-west-1', 'us-east-1'] as any);
|
|
61
|
+
const rendered = renderEditor({
|
|
62
|
+
cloudProvider: 'aws',
|
|
63
|
+
packageName: 'payments',
|
|
64
|
+
regions: ['persisted-region'],
|
|
65
|
+
tags: {},
|
|
66
|
+
});
|
|
92
67
|
|
|
93
|
-
expect(
|
|
68
|
+
expect(await screen.findByRole('checkbox', { name: 'persisted-region' })).toBeChecked();
|
|
69
|
+
expect(await screen.findByRole('checkbox', { name: 'eu-west-1' })).not.toBeChecked();
|
|
70
|
+
expect(await screen.findByRole('checkbox', { name: 'us-east-1' })).not.toBeChecked();
|
|
71
|
+
expect(rendered.updateStageField).not.toHaveBeenCalled();
|
|
94
72
|
});
|
|
95
73
|
|
|
96
|
-
it('updates regions through the stage
|
|
97
|
-
|
|
74
|
+
it('updates package, regions, and map-valued tags through the controlled stage contract', async () => {
|
|
75
|
+
vi.spyOn(BakeryReader, 'getRegions').mockResolvedValue(['eu-west-1'] as any);
|
|
76
|
+
const rendered = renderEditor({ packageName: 'payments', regions: [], tags: { Environment: 'production' } });
|
|
77
|
+
rendered.updateStageField.mockClear();
|
|
98
78
|
|
|
99
|
-
|
|
79
|
+
fireEvent.change(within(getFormGroupByLabel('Package')).getByRole('textbox'), { target: { value: 'transfers' } });
|
|
80
|
+
fireEvent.click(await screen.findByRole('checkbox', { name: 'eu-west-1' }));
|
|
81
|
+
fireEvent.change(within(getFormGroupByLabel('Tags')).getByLabelText('Value'), { target: { value: 'staging' } });
|
|
82
|
+
fireEvent.click(within(getFormGroupByLabel('Tags')).getByRole('button', { name: 'Remove field' }));
|
|
100
83
|
|
|
101
|
-
expect(updateStageField).
|
|
84
|
+
expect(rendered.updateStageField.mock.calls).toEqual([
|
|
85
|
+
[{ packageName: 'transfers' }],
|
|
86
|
+
[{ regions: ['eu-west-1'] }],
|
|
87
|
+
[{ tags: { Environment: 'staging' } }],
|
|
88
|
+
[{ tags: {} }],
|
|
89
|
+
]);
|
|
102
90
|
});
|
|
103
91
|
|
|
104
|
-
it('
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
tags: { Environment: 'production' },
|
|
109
|
-
});
|
|
110
|
-
const onChange = wrapper.find(MapEditor).prop('onChange');
|
|
92
|
+
it('reports a newly added tag field through the controlled stage contract', () => {
|
|
93
|
+
vi.spyOn(BakeryReader, 'getRegions').mockResolvedValue([] as any);
|
|
94
|
+
const rendered = renderEditor({ packageName: 'payments', regions: [], tags: {} });
|
|
95
|
+
rendered.updateStageField.mockClear();
|
|
111
96
|
|
|
112
|
-
|
|
113
|
-
onChange({ Environment: 'staging' }, false);
|
|
114
|
-
onChange({}, false);
|
|
97
|
+
fireEvent.click(within(getFormGroupByLabel('Tags')).getByRole('button', { name: 'Add Field' }));
|
|
115
98
|
|
|
116
|
-
expect(updateStageField.
|
|
117
|
-
|
|
118
|
-
[{ tags: { Environment: 'staging' } }],
|
|
119
|
-
[{ tags: {} }],
|
|
120
|
-
]);
|
|
99
|
+
expect(rendered.updateStageField).toHaveBeenCalledWith({ tags: { '': '' } });
|
|
100
|
+
expect(within(getFormGroupByLabel('Tags')).getByLabelText('Key')).toHaveValue('');
|
|
121
101
|
});
|
|
122
102
|
});
|
|
@@ -1,167 +1,235 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fireEvent, render, screen, waitFor, within } from '@testing-library/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { AccountService, StageConstants } from '@spinnaker/core';
|
|
5
|
+
import { getFormGroupByLabel } from '../../../../../core/src/utils/testUtils/rtl';
|
|
5
6
|
|
|
6
7
|
import { AmazonStageConfig } from '../AmazonStageConfig';
|
|
7
8
|
import { awsModifyScalingProcessStage } from './modifyScalingProcessStage';
|
|
8
9
|
|
|
9
10
|
describe('AWS Modify Scaling Process stage', () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
vi.spyOn(AccountService, 'listAccounts').mockResolvedValue([]);
|
|
13
|
+
vi.spyOn(AccountService, 'getUniqueAttributeForAllAccounts').mockResolvedValue([]);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
function renderEditor(stageOverrides: any = {}, pipeline: any = {}, applicationOverrides: any = {}) {
|
|
17
|
+
const initialStage = { type: 'modifyAwsScalingProcess', cloudProviderType: 'aws', ...stageOverrides };
|
|
18
|
+
const updateStage = vi.fn();
|
|
19
|
+
const updateStageField = vi.fn();
|
|
20
|
+
const StageConfig = awsModifyScalingProcessStage.component as React.ComponentType<any>;
|
|
21
|
+
|
|
22
|
+
function StageHarness() {
|
|
23
|
+
const [stage, setStage] = React.useState(initialStage);
|
|
24
|
+
const update = (changes: any) => {
|
|
25
|
+
updateStage(changes);
|
|
26
|
+
setStage((current: any) => ({ ...current, ...changes }));
|
|
27
|
+
};
|
|
28
|
+
const updateField = (changes: any) => {
|
|
29
|
+
updateStageField(changes);
|
|
30
|
+
setStage((current: any) => ({ ...current, ...changes }));
|
|
31
|
+
};
|
|
32
|
+
return (
|
|
33
|
+
<StageConfig
|
|
34
|
+
application={{
|
|
35
|
+
defaultCredentials: {},
|
|
36
|
+
defaultRegions: {},
|
|
37
|
+
getDataSource: () => ({ data: [] }),
|
|
38
|
+
...applicationOverrides,
|
|
39
|
+
}}
|
|
40
|
+
pipeline={pipeline}
|
|
41
|
+
stage={stage}
|
|
42
|
+
updateStage={update}
|
|
43
|
+
updateStageField={updateField}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
26
47
|
|
|
27
|
-
return {
|
|
48
|
+
return { initialStage, updateStage, updateStageField, ...render(<StageHarness />) };
|
|
28
49
|
}
|
|
29
50
|
|
|
30
51
|
it('registers a dedicated stage editor', () => {
|
|
31
52
|
expect(awsModifyScalingProcessStage.component).not.toBe(AmazonStageConfig);
|
|
32
53
|
});
|
|
33
54
|
|
|
34
|
-
it('renders
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
expect(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
expect(target
|
|
44
|
-
|
|
45
|
-
);
|
|
46
|
-
expect(
|
|
55
|
+
it('renders AWS target, action, and scaling process controls', () => {
|
|
56
|
+
renderEditor({ target: 'current_asg', action: 'suspend', processes: ['Launch'] }, { strategy: true });
|
|
57
|
+
|
|
58
|
+
const target = within(getFormGroupByLabel('Target')).getByRole('combobox');
|
|
59
|
+
expect(
|
|
60
|
+
within(target)
|
|
61
|
+
.getAllByRole('option')
|
|
62
|
+
.map((option) => (option as HTMLOptionElement).value),
|
|
63
|
+
).toEqual(StageConstants.TARGET_LIST.map((option) => option.val));
|
|
64
|
+
expect(target).toHaveValue('current_asg');
|
|
65
|
+
expect(within(getFormGroupByLabel('Action')).getByRole('combobox')).toHaveValue('suspend');
|
|
66
|
+
expect(screen.getByRole('checkbox', { name: 'Launch' })).toBeChecked();
|
|
67
|
+
expect(screen.getByRole('checkbox', { name: 'Terminate' })).not.toBeChecked();
|
|
47
68
|
});
|
|
48
69
|
|
|
49
|
-
it('reports
|
|
50
|
-
const {
|
|
51
|
-
|
|
52
|
-
regions: ['eu-west-1'],
|
|
53
|
-
cluster: 'app-main',
|
|
54
|
-
});
|
|
55
|
-
const selector = wrapper.find(AccountRegionClusterSelector);
|
|
56
|
-
const selectorStage = selector.prop('component');
|
|
70
|
+
it('reports process selections through the controlled stage contract', () => {
|
|
71
|
+
const rendered = renderEditor({ action: 'suspend', processes: ['Launch'] }, { strategy: true });
|
|
72
|
+
rendered.updateStageField.mockClear();
|
|
57
73
|
|
|
58
|
-
|
|
59
|
-
selectorStage.credentials = 'prod';
|
|
60
|
-
selectorStage.regions = ['us-east-1'];
|
|
61
|
-
selectorStage.cluster = 'app-prod';
|
|
62
|
-
selector.prop('onComponentUpdate')(selectorStage);
|
|
74
|
+
fireEvent.click(screen.getByRole('checkbox', { name: 'Terminate' }));
|
|
63
75
|
|
|
64
|
-
expect(
|
|
65
|
-
|
|
76
|
+
expect(rendered.updateStageField).toHaveBeenCalledWith({ processes: ['Launch', 'Terminate'] });
|
|
77
|
+
expect(screen.getByRole('checkbox', { name: 'Terminate' })).toBeChecked();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('reports normal selector changes through updateStage without mutating the stage prop', async () => {
|
|
81
|
+
vi.spyOn(AccountService, 'listAccounts').mockResolvedValue([{ name: 'test' }, { name: 'prod' }] as any);
|
|
82
|
+
vi.spyOn(AccountService, 'getUniqueAttributeForAllAccounts').mockResolvedValue(['eu-west-1', 'us-east-1'] as any);
|
|
83
|
+
const application = {
|
|
84
|
+
getDataSource: () => ({
|
|
85
|
+
data: [
|
|
86
|
+
{ account: 'test', region: 'eu-west-1', cluster: 'app-main', moniker: { app: 'app', cluster: 'app-main' } },
|
|
87
|
+
{ account: 'prod', region: 'us-east-1', cluster: 'app-prod', moniker: { app: 'app', cluster: 'app-prod' } },
|
|
88
|
+
],
|
|
89
|
+
}),
|
|
90
|
+
};
|
|
91
|
+
const accountRendered = renderEditor(
|
|
92
|
+
{
|
|
93
|
+
action: 'suspend',
|
|
94
|
+
cloudProvider: 'aws',
|
|
95
|
+
credentials: 'test',
|
|
96
|
+
processes: [],
|
|
97
|
+
regions: ['eu-west-1'],
|
|
98
|
+
cluster: 'app-main',
|
|
99
|
+
target: 'current_asg_dynamic',
|
|
100
|
+
},
|
|
101
|
+
{ strategy: false },
|
|
102
|
+
application,
|
|
66
103
|
);
|
|
67
|
-
|
|
68
|
-
|
|
104
|
+
const originalAccountStage = {
|
|
105
|
+
...accountRendered.initialStage,
|
|
106
|
+
regions: [...accountRendered.initialStage.regions],
|
|
107
|
+
};
|
|
108
|
+
accountRendered.updateStage.mockClear();
|
|
109
|
+
|
|
110
|
+
const account = within(getFormGroupByLabel('Account')).getByRole('combobox');
|
|
111
|
+
await screen.findByRole('option', { name: 'prod' });
|
|
112
|
+
fireEvent.change(account, { target: { value: 'prod' } });
|
|
113
|
+
|
|
114
|
+
expect(accountRendered.initialStage).toEqual(originalAccountStage);
|
|
115
|
+
expect(accountRendered.updateStage).toHaveBeenCalledExactlyOnceWith({
|
|
116
|
+
type: 'modifyAwsScalingProcess',
|
|
117
|
+
cloudProviderType: 'aws',
|
|
118
|
+
cloudProvider: 'aws',
|
|
119
|
+
credentials: 'prod',
|
|
120
|
+
regions: ['eu-west-1'],
|
|
121
|
+
cluster: undefined,
|
|
122
|
+
processes: [],
|
|
123
|
+
action: 'suspend',
|
|
124
|
+
target: 'current_asg_dynamic',
|
|
125
|
+
});
|
|
126
|
+
accountRendered.unmount();
|
|
127
|
+
|
|
128
|
+
const regionRendered = renderEditor(
|
|
129
|
+
{
|
|
130
|
+
action: 'suspend',
|
|
131
|
+
cloudProvider: 'aws',
|
|
132
|
+
credentials: 'test',
|
|
133
|
+
processes: [],
|
|
134
|
+
regions: ['eu-west-1'],
|
|
135
|
+
cluster: 'app-main',
|
|
136
|
+
target: 'current_asg_dynamic',
|
|
137
|
+
},
|
|
138
|
+
{ strategy: false },
|
|
139
|
+
application,
|
|
69
140
|
);
|
|
70
|
-
|
|
71
|
-
|
|
141
|
+
const originalRegionStage = { ...regionRendered.initialStage, regions: [...regionRendered.initialStage.regions] };
|
|
142
|
+
regionRendered.updateStage.mockClear();
|
|
143
|
+
fireEvent.click(await screen.findByRole('checkbox', { name: 'eu-west-1' }));
|
|
72
144
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
145
|
+
expect(regionRendered.initialStage).toEqual(originalRegionStage);
|
|
146
|
+
expect(regionRendered.updateStage).toHaveBeenCalledExactlyOnceWith({
|
|
147
|
+
type: 'modifyAwsScalingProcess',
|
|
148
|
+
cloudProviderType: 'aws',
|
|
149
|
+
cloudProvider: 'aws',
|
|
150
|
+
credentials: 'test',
|
|
151
|
+
regions: [],
|
|
152
|
+
cluster: undefined,
|
|
153
|
+
processes: [],
|
|
154
|
+
action: 'suspend',
|
|
155
|
+
target: 'current_asg_dynamic',
|
|
156
|
+
});
|
|
157
|
+
regionRendered.unmount();
|
|
158
|
+
|
|
159
|
+
const clusterRendered = renderEditor(
|
|
160
|
+
{
|
|
161
|
+
action: 'suspend',
|
|
162
|
+
cloudProvider: 'aws',
|
|
163
|
+
credentials: 'test',
|
|
164
|
+
processes: [],
|
|
165
|
+
regions: ['eu-west-1'],
|
|
166
|
+
cluster: 'app-main',
|
|
167
|
+
target: 'current_asg_dynamic',
|
|
168
|
+
},
|
|
169
|
+
{ strategy: false },
|
|
170
|
+
application,
|
|
171
|
+
);
|
|
172
|
+
const originalClusterStage = {
|
|
173
|
+
...clusterRendered.initialStage,
|
|
174
|
+
regions: [...clusterRendered.initialStage.regions],
|
|
175
|
+
};
|
|
176
|
+
clusterRendered.updateStage.mockClear();
|
|
177
|
+
fireEvent.change(within(getFormGroupByLabel('Cluster')).getByRole('combobox'), { target: { value: '' } });
|
|
78
178
|
|
|
79
|
-
expect(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
'
|
|
90
|
-
'
|
|
91
|
-
|
|
92
|
-
]);
|
|
93
|
-
expect(checklist.prop('value')).toBe(processes);
|
|
94
|
-
|
|
95
|
-
checklist.prop('onChange')({ target: { value: nextProcesses } } as any);
|
|
96
|
-
|
|
97
|
-
expect(updateStageField).toHaveBeenCalledWith({ processes: nextProcesses });
|
|
179
|
+
expect(clusterRendered.initialStage).toEqual(originalClusterStage);
|
|
180
|
+
expect(clusterRendered.updateStage).toHaveBeenCalledExactlyOnceWith({
|
|
181
|
+
type: 'modifyAwsScalingProcess',
|
|
182
|
+
cloudProviderType: 'aws',
|
|
183
|
+
cloudProvider: 'aws',
|
|
184
|
+
credentials: 'test',
|
|
185
|
+
regions: ['eu-west-1'],
|
|
186
|
+
cluster: undefined,
|
|
187
|
+
moniker: undefined,
|
|
188
|
+
processes: [],
|
|
189
|
+
action: 'suspend',
|
|
190
|
+
target: 'current_asg_dynamic',
|
|
191
|
+
});
|
|
98
192
|
});
|
|
99
193
|
|
|
100
194
|
it('supports suspend and resume while clearing only legacy action fields', () => {
|
|
101
195
|
const processes = ['Launch', 'HealthCheck'];
|
|
102
|
-
const
|
|
103
|
-
action: 'suspend',
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
const { updateStageField, wrapper } = renderEditor(stage);
|
|
109
|
-
const action = wrapper.find('select[name="action"]');
|
|
110
|
-
|
|
111
|
-
expect(action.exists()).toBe(true);
|
|
112
|
-
if (!action.exists()) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
expect(action.find('option').map((option) => [option.prop('value'), option.text()])).toEqual([
|
|
116
|
-
['suspend', 'Suspend'],
|
|
117
|
-
['resume', 'Resume'],
|
|
118
|
-
]);
|
|
196
|
+
const rendered = renderEditor(
|
|
197
|
+
{ action: 'suspend', processes, suspendProcesses: ['Terminate'], resumeProcesses: ['AZRebalance'] },
|
|
198
|
+
{ strategy: true },
|
|
199
|
+
);
|
|
200
|
+
rendered.updateStageField.mockClear();
|
|
119
201
|
|
|
120
|
-
|
|
202
|
+
fireEvent.change(within(getFormGroupByLabel('Action')).getByRole('combobox'), { target: { value: 'resume' } });
|
|
121
203
|
|
|
122
|
-
const changes = updateStageField.
|
|
204
|
+
const changes = rendered.updateStageField.mock.lastCall[0];
|
|
123
205
|
expect(changes).toEqual({ action: 'resume', suspendProcesses: undefined, resumeProcesses: undefined });
|
|
124
206
|
expect(Object.prototype.hasOwnProperty.call(changes, 'processes')).toBe(false);
|
|
125
|
-
expect(
|
|
207
|
+
expect(rendered.initialStage.processes).toBe(processes);
|
|
126
208
|
});
|
|
127
209
|
|
|
128
|
-
it('normalizes legacy process fields when reopening without changing action', () => {
|
|
129
|
-
spyOn(AccountService, 'listAccounts').and.returnValue(Promise.resolve([]));
|
|
210
|
+
it('normalizes legacy process fields when reopening without changing action', async () => {
|
|
130
211
|
const processes = ['Launch', 'ScheduledActions'];
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const updateStageField = jasmine.createSpy('updateStageField');
|
|
145
|
-
const StageConfig = awsModifyScalingProcessStage.component;
|
|
146
|
-
const wrapper = mount(
|
|
147
|
-
<StageConfig
|
|
148
|
-
{...({
|
|
149
|
-
application: { defaultCredentials: {}, defaultRegions: {} },
|
|
150
|
-
pipeline: { strategy: true },
|
|
151
|
-
stage,
|
|
152
|
-
updateStage: jasmine.createSpy('updateStage'),
|
|
153
|
-
updateStageField,
|
|
154
|
-
} as any)}
|
|
155
|
-
/>,
|
|
212
|
+
const rendered = renderEditor(
|
|
213
|
+
{
|
|
214
|
+
cloudProvider: 'aws',
|
|
215
|
+
credentials: 'test',
|
|
216
|
+
regions: ['eu-west-1'],
|
|
217
|
+
cluster: 'app-main',
|
|
218
|
+
target: 'current_asg',
|
|
219
|
+
action: 'suspend',
|
|
220
|
+
processes,
|
|
221
|
+
suspendProcesses: ['Terminate'],
|
|
222
|
+
resumeProcesses: ['AZRebalance'],
|
|
223
|
+
},
|
|
224
|
+
{ strategy: true },
|
|
156
225
|
);
|
|
157
226
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
wrapper.unmount();
|
|
227
|
+
await waitFor(() =>
|
|
228
|
+
expect(rendered.updateStageField).toHaveBeenCalledWith({
|
|
229
|
+
suspendProcesses: undefined,
|
|
230
|
+
resumeProcesses: undefined,
|
|
231
|
+
}),
|
|
232
|
+
);
|
|
233
|
+
expect(rendered.initialStage.processes).toBe(processes);
|
|
166
234
|
});
|
|
167
235
|
});
|