feat: migrate NumberField with form integration and docs
This commit is contained in:
@@ -567,3 +567,35 @@ it("renders Toolbar with nested groups without browser globals", async () => {
|
||||
expect(html).toContain("hv-separator--horizontal");
|
||||
expect(html).toContain('data-slot="button-group"');
|
||||
});
|
||||
|
||||
it("renders NumberField in node with initial control associations and numeric submission", async () => {
|
||||
const {
|
||||
NumberField,
|
||||
NumberFieldGroup,
|
||||
NumberFieldInput,
|
||||
Label,
|
||||
Description,
|
||||
} = await import("../packages/vue/src");
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(
|
||||
NumberField,
|
||||
{ defaultValue: 12.5, name: "amount", locale: "de-DE" },
|
||||
() => [
|
||||
h(Label, {}, () => "Amount"),
|
||||
h(NumberFieldGroup, {}, () => [h(NumberFieldInput)]),
|
||||
h(Description, {}, () => "Help"),
|
||||
],
|
||||
),
|
||||
}),
|
||||
);
|
||||
expect(html).toContain('value="12,5"');
|
||||
expect(html).toContain('name="amount"');
|
||||
const inputId = html.match(/for="([^"]+)"/)?.[1];
|
||||
expect(inputId).toBeTruthy();
|
||||
expect(html).toContain(`id="${inputId}"`);
|
||||
const descriptionId = html.match(/aria-describedby="([^"]+)"/)?.[1];
|
||||
expect(descriptionId).toBeTruthy();
|
||||
expect(html).toContain(`id="${descriptionId}"`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user