CASH-188 | Update unit test

This commit is contained in:
Scott Kiener 2025-04-28 09:12:56 -04:00
parent 1fd3aedf12
commit eb3d013de8

View file

@ -3,6 +3,7 @@ import salesforceWebchat from "./salesforce-webchat.vue";
import * as devHelper from "./salesforce-helper-dev";
import * as qaHelper from "./salesforce-helper-qa";
import * as prodHelper from "./salesforce-helper-prod";
import { applicationConfig } from "../../constants/application-config";
describe("salesforceWebchat.vue", () => {
it("renders correctly", () => {
@ -21,19 +22,19 @@ describe("salesforceWebchat.vue", () => {
});
it("calls the correct initialization function based on environment", () => {
process.env.VUE_APP_CURRENT_ENVIRONMENT = "Prod";
applicationConfig.CURRENT_ENVIRONMENT = "Prod";
let wrapper = shallowMount(salesforceWebchat);
mockProd = jest.spyOn(prodHelper, "initializeSalesforceWebchatForProd");
wrapper.vm.initializeSalesforceWebchat();
expect(mockProd).toHaveBeenCalled();
process.env.VUE_APP_CURRENT_ENVIRONMENT = "QA";
applicationConfig.CURRENT_ENVIRONMENT = "QA";
wrapper = shallowMount(salesforceWebchat);
mockQa = jest.spyOn(qaHelper, "initializeSalesforceWebchatForQa");
wrapper.vm.initializeSalesforceWebchat();
expect(mockQa).toHaveBeenCalled();
process.env.VUE_APP_CURRENT_ENVIRONMENT = "Dev";
applicationConfig.CURRENT_ENVIRONMENT = "Dev";
wrapper = shallowMount(salesforceWebchat);
mockDev = jest.spyOn(devHelper, "initializeSalesforceWebchatForDev");
wrapper.vm.initializeSalesforceWebchat();