From 75f3f355b35fcd778aad55226a2a7b6302ed3d34 Mon Sep 17 00:00:00 2001 From: avior Date: Tue, 14 Feb 2023 13:54:59 +0200 Subject: [PATCH] Add tests --- .../test/cluster-resource-provider.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/@aws-cdk/aws-eks/test/cluster-resource-provider.test.ts b/packages/@aws-cdk/aws-eks/test/cluster-resource-provider.test.ts index f1ad11b562838..a23a343bbc69c 100644 --- a/packages/@aws-cdk/aws-eks/test/cluster-resource-provider.test.ts +++ b/packages/@aws-cdk/aws-eks/test/cluster-resource-provider.test.ts @@ -280,6 +280,25 @@ describe('cluster resource provider', () => { }); }); + test('change subnets or security groups order should not trigger an update', async () => { + const handler = new ClusterResourceHandler(mocks.client, mocks.newRequest('Update', { + ...mocks.MOCK_PROPS, + resourcesVpcConfig: { + subnetIds: ['subnet1', 'subnet2'], + securityGroupIds: ['sg1', 'sg2'], + }, + }, { + ...mocks.MOCK_PROPS, + resourcesVpcConfig: { + subnetIds: ['subnet2', 'subnet1'], + securityGroupIds: ['sg2', 'sg1'], + }, + })); + const resp = await handler.onEvent(); + + expect(resp).toEqual(undefined); + }); + test('"roleArn" requires a replacement', async () => { const handler = new ClusterResourceHandler(mocks.client, mocks.newRequest('Update', { roleArn: 'new-arn',