diff --git a/src/components/base/input/__tests__/Input.spec.ts b/src/components/base/input/__tests__/Input.spec.ts index 85d3e9fa0..0f88f9ece 100644 --- a/src/components/base/input/__tests__/Input.spec.ts +++ b/src/components/base/input/__tests__/Input.spec.ts @@ -1,8 +1,20 @@ import { describe, expect, it } from "vitest"; import { VInput } from "../index"; +import { mount } from "@vue/test-utils"; describe("Input", () => { it("should render", () => { expect(VInput).toBeDefined(); + expect(mount(VInput).html()).toMatchSnapshot(); + }); + + it("should work with size prop", function () { + ["lg", "md", "sm", "xs"].forEach((size) => { + const input = mount(VInput, { props: { size } }); + + expect(input.html()).toMatchSnapshot(); + expect(input.find("input").classes()).toContain(`input-${size}`); + input.unmount(); + }); }); }); diff --git a/src/components/base/input/__tests__/__snapshots__/Input.spec.ts.snap b/src/components/base/input/__tests__/__snapshots__/Input.spec.ts.snap index d39302991..0b4156810 100644 --- a/src/components/base/input/__tests__/__snapshots__/Input.spec.ts.snap +++ b/src/components/base/input/__tests__/__snapshots__/Input.spec.ts.snap @@ -6,3 +6,31 @@ exports[`Input > should render 1`] = ` " `; + +exports[`Input > should work with size prop 1`] = ` +"