fix: 修正 markdown-to-jsx 导入方式 + 新增 formatDateLabel 日期工具函数

- TextPart: default import → named import
- MaterialCard: 使用 formatDateLabel 显示今天/昨天/日期
- 清理旧测试文件,新增 ResourceTable 测试
This commit is contained in:
2026-06-03 21:08:00 +08:00
parent 83cc28fe1b
commit eb93de52d8
17 changed files with 252 additions and 1177 deletions

View File

@@ -1,25 +0,0 @@
/* eslint-disable @typescript-eslint/require-await */
import { screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { DashboardPage } from "../../../src/web/features/dashboard";
import { renderWithProviders } from "../test-utils";
describe("DashboardPage", () => {
test("渲染欢迎信息", () => {
window.fetch = (async () => {
return new Response(
JSON.stringify({ ok: true, service: "test-app", timestamp: new Date().toISOString(), version: "0.1.0" }),
{
headers: { "Content-Type": "application/json" },
status: 200,
},
);
}) as unknown as typeof fetch;
renderWithProviders(createElement(DashboardPage));
expect(screen.getByText(/欢迎使用/)).not.toBeNull();
});
});