chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
import { afterEach, expect, it, vi } from "vitest";
|
||||
import { mount, flushPromises } from "@vue/test-utils";
|
||||
import { createSSRApp, defineComponent, h, type Component } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { CalendarDate } from "@internationalized/date";
|
||||
import {
|
||||
Calendar,
|
||||
CalendarGrid,
|
||||
CalendarGridHeader,
|
||||
CalendarGridBody,
|
||||
} from "../packages/vue/src/index";
|
||||
import { defineComponent, h, type Component } from "vue";
|
||||
const demos = import.meta.glob("../apps/docs/demos/calendar-*.vue", {
|
||||
eager: true,
|
||||
import: "default",
|
||||
@@ -38,29 +30,3 @@ it("mounts all nineteen baseline demos together without duplicate IDs or Vue war
|
||||
expect(new Set(ids).size).toBe(ids.length);
|
||||
expect(warn).not.toHaveBeenCalled();
|
||||
});
|
||||
it("hydrates an explicitly dated calendar without replacing the server grid", async () => {
|
||||
const Root = defineComponent({
|
||||
render: () =>
|
||||
h(
|
||||
Calendar,
|
||||
{
|
||||
defaultFocusedValue: new CalendarDate(2024, 2, 10),
|
||||
locale: "en-US",
|
||||
timeZone: "UTC",
|
||||
},
|
||||
() =>
|
||||
h(CalendarGrid, () => [h(CalendarGridHeader), h(CalendarGridBody)]),
|
||||
),
|
||||
});
|
||||
const host = document.createElement("div");
|
||||
host.innerHTML = await renderToString(createSSRApp(Root));
|
||||
document.body.append(host);
|
||||
const grid = host.querySelector("table");
|
||||
const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
|
||||
const app = createSSRApp(Root);
|
||||
app.mount(host);
|
||||
await flushPromises();
|
||||
expect(host.querySelector("table")).toBe(grid);
|
||||
expect(warn).not.toHaveBeenCalled();
|
||||
app.unmount();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user