chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { createSSRApp, defineComponent, h, nextTick, ref } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { defineComponent, h, nextTick, ref } from "vue";
|
||||
import {
|
||||
Pagination,
|
||||
PaginationContent,
|
||||
@@ -583,41 +582,3 @@ describe("Pagination types", () => {
|
||||
expect(okLink.isActive).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Pagination SSR", () => {
|
||||
it("renders without touching browser globals", async () => {
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(Pagination, { size: "sm" }, () => [
|
||||
h(PaginationSummary, () => "显示第 1–10 条,共 120 条结果"),
|
||||
h(PaginationContent, () => [
|
||||
h(PaginationItem, () =>
|
||||
h(PaginationPrevious, { isDisabled: true }, () => [
|
||||
h(PaginationPreviousIcon),
|
||||
h("span", "上一页"),
|
||||
]),
|
||||
),
|
||||
h(PaginationItem, () =>
|
||||
h(PaginationLink, { isActive: true }, () => "1"),
|
||||
),
|
||||
h(PaginationItem, () => h(PaginationEllipsis)),
|
||||
h(PaginationItem, () =>
|
||||
h(PaginationNext, () => [
|
||||
h("span", "下一页"),
|
||||
h(PaginationNextIcon),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
expect(html).toContain('data-slot="pagination"');
|
||||
expect(html).toContain("hv-pagination--sm");
|
||||
expect(html).toContain('dir="auto"');
|
||||
expect(html).toContain('aria-current="page"');
|
||||
expect(html).toContain('data-active="true"');
|
||||
expect(html).toContain("…");
|
||||
expect(html).toContain("disabled");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user