CSR-2201 extra headers

This commit is contained in:
Sneha 2024-09-13 11:51:58 +05:30
parent e09248e98b
commit eda4d7a149
4 changed files with 11 additions and 1 deletions

View file

@ -1,4 +1,8 @@
export const headerKeys = { export const headerKeys = {
EXPERIMENT: "X-Experiment-Data", EXPERIMENT: "X-Experiment-Data",
APPLICATION_NAME: "AppName", APPLICATION_NAME: "Application-Name",
REFERRAL_SEQUENCE_NUMBER: "referral-Sequence-Number",
SESSION_SEQUENCE_NUMBER: "session-Sequence-Number",
TRANSACTION_ID: "transaction-Id",
EON: "eon",
}; };

View file

@ -61,6 +61,10 @@ export default {
const headers = { const headers = {
[headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings), [headerKeys.EXPERIMENT]: JSON.stringify(store.getters.experimentSettings),
[headerKeys.APPLICATION_NAME]: applicationConfig.APPLICATION_NAME, [headerKeys.APPLICATION_NAME]: applicationConfig.APPLICATION_NAME,
[headerKeys.SESSION_SEQUENCE_NUMBER]: store.getters.applicationUser?.savedSessionId,
[headerKeys.REFERRAL_SEQUENCE_NUMBER]: store.getters.order?.referralSequenceNumber,
[headerKeys.TRANSACTION_ID]: crypto.randomUUID(),
[headerKeys.EON]: store.getters.order?.eon,
}; };
axios({ axios({

View file

@ -13,6 +13,7 @@ global.$logger = {
logError: jest.fn(), logError: jest.fn(),
logCritical: jest.fn(), logCritical: jest.fn(),
}; };
global.crypto = { randomUUID: jest.fn() };
it("Global Methods - Call Http Client - Should Resolve Promise", () => { it("Global Methods - Call Http Client - Should Resolve Promise", () => {
//Arrange //Arrange

View file

@ -24,6 +24,7 @@ jest.mock("@/helpers/cms-content-helper", () => ({
fetchCmsContentForPage: jest.fn(), fetchCmsContentForPage: jest.fn(),
})); }));
global.crypto = { randomUUID: jest.fn() };
describe("estimate.vue", () => { describe("estimate.vue", () => {
test("Selected vin option is emitted upon selection.", async () => { test("Selected vin option is emitted upon selection.", async () => {
//Arrange //Arrange