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