feat: initialize Vue component library and aligned documentation
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// @vitest-environment node
|
||||
import { it, expect } from "vitest";
|
||||
import { createSSRApp, h } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { Button, Card, Input, Switch } from "../packages/vue/src";
|
||||
it("renders the initial components without browser globals", async () => {
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(Card, () => [
|
||||
h(Button, () => "保存"),
|
||||
h(Input, { modelValue: "名称" }),
|
||||
h(Switch, { checked: true, "aria-label": "通知" }),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
expect(html).toContain("保存");
|
||||
expect(html).toContain('value="名称"');
|
||||
expect(html).toContain('role="switch"');
|
||||
});
|
||||
Reference in New Issue
Block a user