CSR-216: fix unit tests
This commit is contained in:
parent
adb74675ff
commit
e13d2fc097
3 changed files with 60 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import listButtonHorizontal from "./list-button-horizontal";
|
import listButtonHorizontal from "./list-button-horizontal";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
|
import { GaActions } from "@/constants/analytics";
|
||||||
|
|
||||||
describe("list-button-horizontal.vue", () => {
|
describe("list-button-horizontal.vue", () => {
|
||||||
it("Should return input type checkbox if isMultiSelect is true", async () => {
|
it("Should return input type checkbox if isMultiSelect is true", async () => {
|
||||||
|
|
@ -90,6 +91,13 @@ describe("list-button-horizontal.vue", () => {
|
||||||
it("Should return loader enabled true", async () => {
|
it("Should return loader enabled true", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
|
|
@ -112,6 +120,13 @@ describe("list-button-horizontal.vue", () => {
|
||||||
it("Should return loader color", async () => {
|
it("Should return loader color", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderColor: "blue",
|
loaderColor: "blue",
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
|
|
@ -135,6 +150,13 @@ describe("list-button-horizontal.vue", () => {
|
||||||
it("Should return loader position", async () => {
|
it("Should return loader position", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButtonHorizontal, {
|
const wrapper = shallowMount(listButtonHorizontal, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderPosition: "right",
|
loaderPosition: "right",
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import listButton from "./list-button";
|
import listButton from "./list-button";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
|
import { GaActions } from "@/constants/analytics";
|
||||||
|
|
||||||
describe("list-button.vue", () => {
|
describe("list-button.vue", () => {
|
||||||
it("Should return input type checkbox if isMultiSelect is true", async () => {
|
it("Should return input type checkbox if isMultiSelect is true", async () => {
|
||||||
|
|
@ -90,6 +91,13 @@ describe("list-button.vue", () => {
|
||||||
it("Should return loader enabled true", async () => {
|
it("Should return loader enabled true", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
|
|
@ -109,6 +117,13 @@ describe("list-button.vue", () => {
|
||||||
it("Should return loader color", async () => {
|
it("Should return loader color", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderColor: "blue",
|
loaderColor: "blue",
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
|
|
@ -128,6 +143,13 @@ describe("list-button.vue", () => {
|
||||||
it("Should return loader position", async () => {
|
it("Should return loader position", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listButton, {
|
const wrapper = shallowMount(listButton, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
loaderPosition: "right",
|
loaderPosition: "right",
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import listCard from "./list-card";
|
import listCard from "./list-card";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
|
import { GaActions } from "@/constants/analytics";
|
||||||
|
|
||||||
describe("list-card.vue", () => {
|
describe("list-card.vue", () => {
|
||||||
it("Should return input type checkbox if isMultiSelect is true", async () => {
|
it("Should return input type checkbox if isMultiSelect is true", async () => {
|
||||||
|
|
@ -292,8 +293,16 @@ describe("list-card.vue", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should run handleChange if triggerButton is triggered", async () => {
|
it("Should run handleChange if triggerButton is triggered", async () => {
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listCard, {
|
const wrapper = shallowMount(listCard, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
selectingInitiatesLoad: false,
|
selectingInitiatesLoad: false,
|
||||||
},
|
},
|
||||||
|
|
@ -312,6 +321,13 @@ describe("list-card.vue", () => {
|
||||||
it("Should run handleCheckChange and displayLoader if triggerButton is triggered and seletingInitiatesLoad is true", async () => {
|
it("Should run handleCheckChange and displayLoader if triggerButton is triggered and seletingInitiatesLoad is true", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(listCard, {
|
const wrapper = shallowMount(listCard, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
selectingInitiatesLoad: true,
|
selectingInitiatesLoad: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue