Fixed broken tests
This commit is contained in:
parent
b73649e490
commit
5006a22221
4 changed files with 19 additions and 4 deletions
|
|
@ -31,6 +31,6 @@ const GaLabels = {
|
||||||
|
|
||||||
const ValueToLogTypes = {
|
const ValueToLogTypes = {
|
||||||
LAST_5: "last_5",
|
LAST_5: "last_5",
|
||||||
}
|
};
|
||||||
|
|
||||||
export { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes };
|
export { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes };
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { cookieNames } from "@/constants/cookie-names";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
import { getCookieDomainValue } from "@/helpers/heritage-integration/cookie-helper";
|
import { getCookieDomainValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, LabelToLogTypes } from "@/constants/analytics";
|
import { analyticsPageEvents, GaCategories, GaActions, GaLabels, GaEvents, ValueToLogTypes } from "@/constants/analytics";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { routerParams } from "@/router/router-constants/router-params";
|
import { routerParams } from "@/router/router-constants/router-params";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { shallowMount } from "@vue/test-utils";
|
import { shallowMount } from "@vue/test-utils";
|
||||||
import radio from "./radio";
|
import radio from "./radio";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
|
import { GaActions } from "@/constants/analytics";
|
||||||
|
|
||||||
describe("radio.vue", () => {
|
describe("radio.vue", () => {
|
||||||
it("Should return group name", async () => {
|
it("Should return group name", async () => {
|
||||||
|
|
@ -64,6 +65,13 @@ describe("radio.vue", () => {
|
||||||
it("Should emit button value on click", async () => {
|
it("Should emit button value on click", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(radio, {
|
const wrapper = shallowMount(radio, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
buttonLabel: "Windshield",
|
buttonLabel: "Windshield",
|
||||||
value: "List Card Checkbox",
|
value: "List Card Checkbox",
|
||||||
|
|
@ -83,6 +91,13 @@ describe("radio.vue", () => {
|
||||||
it("Should set checkValue data if selectedButtonIDs has value(s)", async () => {
|
it("Should set checkValue data if selectedButtonIDs has value(s)", async () => {
|
||||||
// Act
|
// Act
|
||||||
const wrapper = shallowMount(radio, {
|
const wrapper = shallowMount(radio, {
|
||||||
|
global: {
|
||||||
|
mocks: {
|
||||||
|
'$route': { query: { fmgPage: 'page-name' } },
|
||||||
|
GaActions: GaActions,
|
||||||
|
pushEventToGA: jest.fn(),
|
||||||
|
}
|
||||||
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
buttonLabel: "Windshield",
|
buttonLabel: "Windshield",
|
||||||
buttonID: "List Card Checkbox",
|
buttonID: "List Card Checkbox",
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,10 @@ export default {
|
||||||
buttonID: this.buttonID && this.buttonID.toString(),
|
buttonID: this.buttonID && this.buttonID.toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true, this.valueToLogType);
|
|
||||||
|
|
||||||
this.$emit("isCheckedChanged", emitEvent);
|
this.$emit("isCheckedChanged", emitEvent);
|
||||||
this.$emit("update:modelValue", emitEvent);
|
this.$emit("update:modelValue", emitEvent);
|
||||||
|
|
||||||
|
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], this.GaActions.CLICKED, this.value.toString(), true, this.valueToLogType);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue