From ad65321e8222095d69cdd2525eef0e8c0825ae52 Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Sun, 7 Jul 2024 12:30:44 +0900 Subject: [PATCH] add unit test --- .../aws-cdk-lib/aws-eks/test/addon.test.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/aws-cdk-lib/aws-eks/test/addon.test.ts b/packages/aws-cdk-lib/aws-eks/test/addon.test.ts index 02854db795216..249d584b5b0c4 100644 --- a/packages/aws-cdk-lib/aws-eks/test/addon.test.ts +++ b/packages/aws-cdk-lib/aws-eks/test/addon.test.ts @@ -54,6 +54,26 @@ describe('Addon', () => { }, }); }); + test('create a new Addon with preserveOnDelete', () => { + // GIVEN + + // WHEN + new Addon(stack, 'TestAddonWithPreserveOnDelete', { + addonName: 'test-addon', + cluster, + preserveOnDelete: false, + }); + + // THEN + const t = Template.fromStack(stack); + t.hasResourceProperties('AWS::EKS::Addon', { + AddonName: 'test-addon', + ClusterName: { + Ref: 'Cluster9EE0221C', + }, + PreserveOnDelete: false, + }); + }); test('creates an Addon from attributes', () => { // GIVEN