Skip to content

Commit 18b2e89

Browse files
alexnuttallClareJonesBJSS
authored andcommitted
CCM-8574: Fix for failing e2es
1 parent b4e4bd1 commit 18b2e89

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

tests/test-team/config/e2e/e2e.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import baseConfig from '../playwright.config';
44

55
const buildCommand = [
66
'INCLUDE_AUTH_PAGES=true',
7-
'NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS=25',
7+
'NEXT_PUBLIC_TIME_TILL_LOGOUT_SECONDS=900',
88
'NEXT_PUBLIC_PROMPT_SECONDS_BEFORE_LOGOUT=5',
99
'NEXT_PUBLIC_ENABLE_LETTERS=true',
1010
'npm run build && npm run start',

tests/test-team/helpers/db/template-storage-helper.ts

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -105,39 +105,20 @@ export class TemplateStorageHelper {
105105
)
106106
);
107107

108-
const owners = keys
109-
.map((key) => key.owner)
110-
.filter((owner, i, list) => list.indexOf(owner) === i);
108+
const files = keys.flatMap((key) => [
109+
`pdf-template/${key.owner}/${key.id}.pdf`,
110+
`test-data/${key.owner}/${key.id}.csv`,
111+
]);
111112

112-
const files = await Promise.all(
113-
owners.map(async (owner) => {
114-
const pdfs = await this.s3.send(
115-
new ListObjectsV2Command({
116-
Bucket: process.env.TEMPLATES_INTERNAL_BUCKET_NAME,
117-
Prefix: `pdf-template/${owner}`,
118-
})
119-
);
120-
121-
const csvs = await this.s3.send(
122-
new ListObjectsV2Command({
123-
Bucket: process.env.TEMPLATES_INTERNAL_BUCKET_NAME,
124-
Prefix: `test-data/${owner}`,
125-
})
126-
);
127-
128-
return [...(pdfs.Contents || []), ...(csvs.Contents || [])];
129-
})
130-
);
131-
132-
const s3Chunks = TemplateStorageHelper.chunk(files.flat(), 1000);
113+
const s3Chunks = TemplateStorageHelper.chunk(files, 1000);
133114

134115
await Promise.all(
135116
s3Chunks.map((chunk) =>
136117
this.s3.send(
137118
new DeleteObjectsCommand({
138119
Bucket: process.env.TEMPLATES_INTERNAL_BUCKET_NAME,
139120
Delete: {
140-
Objects: chunk.map(({ Key }) => ({ Key })),
121+
Objects: chunk.map((key) => ({ Key: key })),
141122
},
142123
})
143124
)

0 commit comments

Comments
 (0)