INSR-10442: Remove debug logging, update some tests

This commit is contained in:
Alex Humphries 2026-07-20 11:44:17 -04:00
parent 7f424a1f4f
commit 6ba3a55274
3 changed files with 19 additions and 34 deletions

View file

@ -1,7 +1,6 @@
import { useMainStore } from "@/store";
export function updateClaimRegistrationPayload(payload) {
console.log(`updating payload for USAA`)
const mainStore = useMainStore();
payload.additionalInfo = {
offeredItac: mainStore.isITAC ? 'true' : 'false',

View file

@ -3,12 +3,8 @@ import { useMainStore } from "@/store";
export async function updateClientSpecificFieldsForClaimRegistration(payload) {
const mainStore = useMainStore();
try {
console.log(`Updating client-specific fields for claim registration for parent account number: ${mainStore.order.parentAccountNumber}`);
const clientMapper = await import(`@/helpers/client-mappers/Client${mainStore.order.parentAccountNumber}Coverage.js`);
console.log(`Loaded client mapper: ${clientMapper}`);
clientMapper.updateClaimRegistrationPayload(payload);
}
catch (error) {
console.error('Error updating client-specific fields for claim registration:', error);
}
catch (error) { }
}

View file

@ -18,36 +18,26 @@ describe('coverage-helper.js', () => {
jest.clearAllMocks();
});
describe.each([
[900040, true],
[900040, false],
['900040', true],
['900040', false]
])('custom claim registration for client 900040', (parentAccountNumber, isITAC) => {
test(`Sets additionalInfo fields when parent account is ${parentAccountNumber} and isITAC is ${isITAC}`, async () => {
// Arrange
const payload = {};
mockStore.order.parentAccountNumber = parentAccountNumber;
mockStore.isITAC = isITAC;
test('Sets additionalInfo fields when parent account is 900040 and isITAC is true', async () => {
// Arrange
const payload = {};
mockStore.order.parentAccountNumber = 900040;
mockStore.isITAC = true;
// Act
await updateClientSpecificFieldsForClaimRegistration(payload);
// Act
await updateClientSpecificFieldsForClaimRegistration(payload);
// Assert
expect(payload.additionalInfo).toEqual({
offeredItac: 'true',
qualifiedForItac: 'true'
});
});
test('Sets additionalInfo fields when parent account is 900040 and isITAC is false', async () => {
// Arrange
const payload = {};
mockStore.order.parentAccountNumber = 900040;
mockStore.isITAC = false;
// Act
await updateClientSpecificFieldsForClaimRegistration(payload);
// Assert
expect(payload.additionalInfo).toEqual({
offeredItac: 'false',
qualifiedForItac: 'false'
// Assert
expect(payload.additionalInfo).toEqual({
offeredItac: isITAC.toString(),
qualifiedForItac: isITAC.toString()
});
});
});