Unit tests
This commit is contained in:
parent
9e53ab9c22
commit
a96d45c4a5
1 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { shallowMount } from "@vue/test-utils";
|
||||
import salesforceWebchat from "./salesforce-webchat.vue";
|
||||
import * as devHelper from "./salesforce-helper-dev";
|
||||
import * as qaHelper from "./salesforce-helper-qa";
|
||||
import * as sysHelper from "./salesforce-helper-sys";
|
||||
import * as prodHelper from "./salesforce-helper-prod";
|
||||
import { applicationConfig } from "../../constants/application-config";
|
||||
|
|
@ -42,10 +43,16 @@ describe("salesforceWebchat.vue", () => {
|
|||
|
||||
applicationConfig.CURRENT_ENVIRONMENT = "QA";
|
||||
wrapper = shallowMount(salesforceWebchat);
|
||||
const mockQa = jest.spyOn(sysHelper, "initializeSalesforceWebchatForSys");
|
||||
const mockQa = jest.spyOn(qaHelper, "initializeSalesforceWebchatForQa");
|
||||
wrapper.vm.initializeSalesforceWebchat();
|
||||
expect(mockQa).toHaveBeenCalled();
|
||||
|
||||
applicationConfig.CURRENT_ENVIRONMENT = "SysTest";
|
||||
wrapper = shallowMount(salesforceWebchat);
|
||||
const mockSys = jest.spyOn(sysHelper, "initializeSalesforceWebchatForSys");
|
||||
wrapper.vm.initializeSalesforceWebchat();
|
||||
expect(mockSys).toHaveBeenCalled();
|
||||
|
||||
applicationConfig.CURRENT_ENVIRONMENT = "Dev";
|
||||
wrapper = shallowMount(salesforceWebchat);
|
||||
const mockDev = jest.spyOn(devHelper, "initializeSalesforceWebchatForDev");
|
||||
|
|
|
|||
Loading…
Reference in a new issue