import { mount } from "@vue/test-utils"; import { beforeEach, describe, expect, test, vi } from "vitest"; import { nextTick } from "vue"; import RecipeIngredients from "./RecipeIngredients.vue"; import type { RecipeIngredient } from "~/lib/api/types/recipe"; import { useLocales } from "~/composables/use-locales"; vi.mock("~/composables/use-locales"); const ingredients = { curryPaste: { referenceId: "ingredient-curry-paste", quantity: 1, food: { id: "food-1", name: "curry paste" }, }, coconutMilk: { referenceId: "ingredient-coconut-milk", quantity: 1, food: { id: "food-2", name: "coconut milk" }, }, } satisfies Record; function mountIngredients(value: RecipeIngredient[], storageKey = "recipe-ingredients:test-recipe:checked") { return mount(RecipeIngredients, { props: { value, storageKey, }, global: { stubs: { AppButtonCopy: true, RecipeIngredientListItem: true, VCheckbox: { props: ["modelValue"], emits: ["update:modelValue"], template: `