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:
parent
81a35dd0bb
commit
8a1933d76f
1 changed files with 5 additions and 5 deletions
|
|
@ -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 = [],
|
||||
}) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue