Skip to content

Commit bd37834

Browse files
author
Kanishka
committed
fix: include sandbox configurations in ConfigurationDto
1 parent 523d9e6 commit bd37834

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/dto/configuration.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,13 @@ export const ConfigurationDto = {
2626
...(configuration.getHandlers() ? { handlers: configuration.getHandlers() } : {}),
2727
queues: configuration.getQueues(),
2828
...(configuration.getSlackRoles() ? { slackRoles: configuration.getSlackRoles() } : {}),
29+
...(configuration.getEnabledSandboxAudits && configuration.getEnabledSandboxAudits().length > 0
30+
? {
31+
sandboxAudits: configuration.getEnabledSandboxAudits().reduce((acc, auditType) => {
32+
acc[auditType] = configuration.getSandboxAuditConfig(auditType);
33+
return acc;
34+
}, {}),
35+
}
36+
: {}),
2937
}),
3038
};

test/controllers/configurations.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ describe('Configurations Controller', () => {
3838
getHandlers: () => {},
3939
getQueues: () => ({ reports: 'sqs://some-reports-queue' }),
4040
getSlackRoles: () => {},
41+
getEnabledSandboxAudits: () => [],
42+
getSandboxAuditConfig: () => null,
4143
},
4244
{
4345
getVersion: () => 2,
@@ -81,6 +83,12 @@ describe('Configurations Controller', () => {
8183
'S03CR0FDC2V',
8284
],
8385
}),
86+
getEnabledSandboxAudits: () => ['cwv', 'meta-tags'],
87+
getSandboxAuditConfig: (auditType) => {
88+
if (auditType === 'cwv') return { expire: '10' };
89+
if (auditType === 'meta-tags') return { expire: '15' };
90+
return null;
91+
},
8492
},
8593
];
8694

0 commit comments

Comments
 (0)