CASH-188 | Update unit test
This commit is contained in:
parent
1fd3aedf12
commit
eb3d013de8
1 changed files with 4 additions and 3 deletions
|
|
@ -3,6 +3,7 @@ import salesforceWebchat from "./salesforce-webchat.vue";
|
||||||
import * as devHelper from "./salesforce-helper-dev";
|
import * as devHelper from "./salesforce-helper-dev";
|
||||||
import * as qaHelper from "./salesforce-helper-qa";
|
import * as qaHelper from "./salesforce-helper-qa";
|
||||||
import * as prodHelper from "./salesforce-helper-prod";
|
import * as prodHelper from "./salesforce-helper-prod";
|
||||||
|
import { applicationConfig } from "../../constants/application-config";
|
||||||
|
|
||||||
describe("salesforceWebchat.vue", () => {
|
describe("salesforceWebchat.vue", () => {
|
||||||
it("renders correctly", () => {
|
it("renders correctly", () => {
|
||||||
|
|
@ -21,19 +22,19 @@ describe("salesforceWebchat.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("calls the correct initialization function based on environment", () => {
|
it("calls the correct initialization function based on environment", () => {
|
||||||
process.env.VUE_APP_CURRENT_ENVIRONMENT = "Prod";
|
applicationConfig.CURRENT_ENVIRONMENT = "Prod";
|
||||||
let wrapper = shallowMount(salesforceWebchat);
|
let wrapper = shallowMount(salesforceWebchat);
|
||||||
mockProd = jest.spyOn(prodHelper, "initializeSalesforceWebchatForProd");
|
mockProd = jest.spyOn(prodHelper, "initializeSalesforceWebchatForProd");
|
||||||
wrapper.vm.initializeSalesforceWebchat();
|
wrapper.vm.initializeSalesforceWebchat();
|
||||||
expect(mockProd).toHaveBeenCalled();
|
expect(mockProd).toHaveBeenCalled();
|
||||||
|
|
||||||
process.env.VUE_APP_CURRENT_ENVIRONMENT = "QA";
|
applicationConfig.CURRENT_ENVIRONMENT = "QA";
|
||||||
wrapper = shallowMount(salesforceWebchat);
|
wrapper = shallowMount(salesforceWebchat);
|
||||||
mockQa = jest.spyOn(qaHelper, "initializeSalesforceWebchatForQa");
|
mockQa = jest.spyOn(qaHelper, "initializeSalesforceWebchatForQa");
|
||||||
wrapper.vm.initializeSalesforceWebchat();
|
wrapper.vm.initializeSalesforceWebchat();
|
||||||
expect(mockQa).toHaveBeenCalled();
|
expect(mockQa).toHaveBeenCalled();
|
||||||
|
|
||||||
process.env.VUE_APP_CURRENT_ENVIRONMENT = "Dev";
|
applicationConfig.CURRENT_ENVIRONMENT = "Dev";
|
||||||
wrapper = shallowMount(salesforceWebchat);
|
wrapper = shallowMount(salesforceWebchat);
|
||||||
mockDev = jest.spyOn(devHelper, "initializeSalesforceWebchatForDev");
|
mockDev = jest.spyOn(devHelper, "initializeSalesforceWebchatForDev");
|
||||||
wrapper.vm.initializeSalesforceWebchat();
|
wrapper.vm.initializeSalesforceWebchat();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue