INSR-10442: Remove debug logging, update some tests
This commit is contained in:
parent
7f424a1f4f
commit
6ba3a55274
3 changed files with 19 additions and 34 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import { useMainStore } from "@/store";
|
import { useMainStore } from "@/store";
|
||||||
|
|
||||||
export function updateClaimRegistrationPayload(payload) {
|
export function updateClaimRegistrationPayload(payload) {
|
||||||
console.log(`updating payload for USAA`)
|
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
payload.additionalInfo = {
|
payload.additionalInfo = {
|
||||||
offeredItac: mainStore.isITAC ? 'true' : 'false',
|
offeredItac: mainStore.isITAC ? 'true' : 'false',
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,8 @@ import { useMainStore } from "@/store";
|
||||||
export async function updateClientSpecificFieldsForClaimRegistration(payload) {
|
export async function updateClientSpecificFieldsForClaimRegistration(payload) {
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
try {
|
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`);
|
const clientMapper = await import(`@/helpers/client-mappers/Client${mainStore.order.parentAccountNumber}Coverage.js`);
|
||||||
console.log(`Loaded client mapper: ${clientMapper}`);
|
|
||||||
clientMapper.updateClaimRegistrationPayload(payload);
|
clientMapper.updateClaimRegistrationPayload(payload);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) { }
|
||||||
console.error('Error updating client-specific fields for claim registration:', error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -18,36 +18,26 @@ describe('coverage-helper.js', () => {
|
||||||
|
|
||||||
jest.clearAllMocks();
|
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 () => {
|
// Act
|
||||||
// Arrange
|
await updateClientSpecificFieldsForClaimRegistration(payload);
|
||||||
const payload = {};
|
|
||||||
mockStore.order.parentAccountNumber = 900040;
|
|
||||||
mockStore.isITAC = true;
|
|
||||||
|
|
||||||
// Act
|
// Assert
|
||||||
await updateClientSpecificFieldsForClaimRegistration(payload);
|
expect(payload.additionalInfo).toEqual({
|
||||||
|
offeredItac: isITAC.toString(),
|
||||||
// Assert
|
qualifiedForItac: isITAC.toString()
|
||||||
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'
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue