1- import { Stack } from "aws-cdk-lib" ;
1+ import { Duration , Stack } from "aws-cdk-lib" ;
22import { Template } from "aws-cdk-lib/assertions" ;
33import { IWidget , TextWidget } from "aws-cdk-lib/aws-cloudwatch" ;
44import { DynamicDashboardFactory , IDynamicDashboardSegment } from "../../lib" ;
@@ -28,7 +28,7 @@ test("dynamic dashboards created", () => {
2828 dashboardNamePrefix : "testPrefix" ,
2929 dashboardConfigs : [
3030 { name : TestDashboards . Dynamic1 } ,
31- { name : TestDashboards . Dynamic2 } ,
31+ { name : TestDashboards . Dynamic2 , range : Duration . days ( 7 ) } ,
3232 ] ,
3333 } ) ;
3434
@@ -45,7 +45,7 @@ test("dynamic dashboards created", () => {
4545 DashboardName : "testPrefix-Dynamic1" ,
4646 } ) ;
4747 result . hasResourceProperties ( "AWS::CloudWatch::Dashboard" , {
48- DashboardBody : `{"start":"-PT8H ","periodOverride":"inherit","widgets":[{"type":"text","width":6,"height":2,"x":0,"y":0,"properties":{"markdown":"Dynamic2"}}]}` ,
48+ DashboardBody : `{"start":"-P7D ","periodOverride":"inherit","widgets":[{"type":"text","width":6,"height":2,"x":0,"y":0,"properties":{"markdown":"Dynamic2"}}]}` ,
4949 DashboardName : "testPrefix-Dynamic2" ,
5050 } ) ;
5151} ) ;
0 commit comments