Skip to content

Commit ccf6f45

Browse files
fix comments
1 parent eeaeff0 commit ccf6f45

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

tests/component-tests/allocation-tests/letter-allocation-rejected.spec.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
getAllocationLogForDomainId,
77
getVariantsForAllocation,
88
getVolumeGroupData,
9-
updateLetterVariantConfig,
9+
updateLetterVariantPackSpecs,
1010
updateVolumeGroupData,
1111
} from "tests/helpers/allocation-helper";
1212
import { createPreparedV1Event } from "tests/helpers/event-fixtures";
@@ -63,7 +63,7 @@ test.describe("Allocator Rejected Allocation Tests", () => {
6363
});
6464

6565
if (letterVariantMapping === 7) {
66-
await updateLetterVariantConfig(letterVariant, [""]);
66+
await updateLetterVariantPackSpecs(letterVariant, [""]);
6767
}
6868

6969
const response = await sendSnsEvent(preparedEvent);
@@ -104,7 +104,9 @@ test.describe("Allocator Rejected Allocation Tests", () => {
104104
expect(lettersInDb.reasonText).toContain(
105105
`No pack specification found for id`,
106106
);
107-
await updateLetterVariantConfig(letterVariant, ["notify-c5-colour"]); // update back to valid config for other tests
107+
await updateLetterVariantPackSpecs(letterVariant, [
108+
"notify-c5-colour",
109+
]); // update back to valid config for other tests
108110
break;
109111
}
110112
default: {
@@ -133,8 +135,9 @@ test.describe("Allocator Rejected Allocation Tests", () => {
133135
const letterVariant = getVariantsForAllocation(8);
134136
logger.info(`Testing volumeGroup with ${fieldToUpdate}: ${domainId}`);
135137

136-
const { originalEndDate, originalStartDate } =
137-
await getVolumeGroupData(volumeGroupId);
138+
const volumeGroupData = await getVolumeGroupData(volumeGroupId);
139+
const originalStartDate = volumeGroupData.startDate;
140+
const originalEndDate = volumeGroupData.endDate;
138141

139142
const [futureStartDate] = new Date(Date.now() + 24 * 60 * 60 * 1000)
140143
.toISOString()

tests/helpers/allocation-helper.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,7 @@ export async function updateVolumeGroupData(
405405
);
406406
}
407407

408-
export async function getVolumeGroupData(volumeGroupId: string): Promise<{
409-
originalStartDate: string;
410-
originalEndDate: string;
411-
}> {
408+
export async function getVolumeGroupData(volumeGroupId: string): Promise<any> {
412409
const { Item } = await docClient.send(
413410
new GetCommand({
414411
TableName: getSupplierConfigTableName(),
@@ -425,10 +422,7 @@ export async function getVolumeGroupData(volumeGroupId: string): Promise<{
425422
);
426423
}
427424

428-
return {
429-
originalEndDate: Item.endDate,
430-
originalStartDate: Item.startDate,
431-
};
425+
return Item;
432426
}
433427

434428
export async function updateSupplierAllocation(
@@ -460,7 +454,7 @@ export async function updateSupplierAllocation(
460454
);
461455
}
462456

463-
export async function updateLetterVariantConfig(
457+
export async function updateLetterVariantPackSpecs(
464458
letterVariantId: string,
465459
packSpecificationIds: string[],
466460
) {

0 commit comments

Comments
 (0)