Change String to Number

The actual implementation in the component is using number instead of a string. The tests should match that.
This commit is contained in:
Johan Gunawan 2022-12-05 16:10:45 -05:00
parent 81a35dd0bb
commit 8a1933d76f

View file

@ -6,8 +6,8 @@ import { useMainStore } from "@/store";
describe("year-question.vue", () => {
test("Selected year is emitted upon selection.", async () => {
//Arrange
const { wrapper } = setupMocks({ modelValueProp: "2020" });
const yearToSelect = "2021";
const { wrapper } = setupMocks({ modelValueProp: 2020 });
const yearToSelect = 2021;
//Act
wrapper.setValue({ modelValue: yearToSelect });
@ -15,7 +15,7 @@ describe("year-question.vue", () => {
//Assert
expect(wrapper.emitted()["update:modelValue"][0]).toEqual([
{ modelValue: "2021" },
{ modelValue: 2021 },
]);
});
});
@ -24,7 +24,7 @@ describe("year-question.vue", () => {
test("Data from store api are used as radio question answers.", async () => {
//Arrange
const { wrapper, cmsContent } = setupMocks({
dataFromStoreApi: ["2023", "2022", "2021"],
dataFromStoreApi: [2023, 2022, 2021],
});
//Act
@ -46,7 +46,7 @@ describe("year-question.vue", () => {
function setupMocks({
modelValueProp = "1900",
modelValueProp = 1900,
cmsQuestionText = "CMS text goes here",
dataFromStoreApi = [],
}) {