Files
creator-hub/web/tests/table-fixed-header.test.cjs
T
rogee 7dea052e55 feat(web): 账号即环境 UI 收敛——删 /browsers 页面,环境并入账号详情
- 删除 /browsers 列表/创建/详情页与菜单项,运行环境不再是独立资源
- 账号详情:GET /api/phase-a/accounts/:id 内联 environment 字段
  (网关/出口/绑定版本/运行实例/不可调度原因),固定资源卡直接展示
- 状态卡两态开关:暂停→「启动账号」(start=resume+启动环境),
  运行中→「暂停账号」(联动停环境);出口重绑卡片内完成
  (POST /network-exits/:id/rebind 返回内联 environment,出口切换不再跳环境页)
- 删除 creator/settings 残留的转写服务字段(后端 settings 无此列)
- helpers.ts accountReadiness 改用 runtime_id/runtime_cleanup_pending
- network-exits 列表绑定账号列改由账号列表内联数据驱动
- 全量验证:go test ./...(PG)全绿、tsc --noEmit 通过、max build 通过、
  node --test 12/12 通过
2026-09-28 20:30:23 +08:00

34 lines
1.3 KiB
JavaScript

const assert = require('node:assert/strict');
const { readFileSync } = require('node:fs');
const { test } = require('node:test');
const ts = require('typescript');
// 表格统一形态:固定表头(scroll.y)+ sticky 兜底 + 横向滚动 + 操作列固定右侧 + 分页。
const files = [
'src/components/accounts/MonitoringAccountList.tsx',
'src/components/accounts/AccountManagementList.tsx',
'src/pages/accounts/import.tsx',
'src/pages/network-exits/index.tsx',
'src/pages/gateways/index.tsx',
];
for (const file of files) {
const source = ts.createSourceFile(
file,
readFileSync(`${__dirname}/../${file}`, 'utf8'),
ts.ScriptTarget.Latest,
true,
ts.ScriptKind.TSX,
);
const code = source.getFullText();
test(`${file} 表格使用统一固定表头与分页形态`, () => {
assert.match(code, /sticky/, '应开启表头吸顶兜底');
assert.match(code, /pagination=\{tablePagination\(\)\}/, '应恢复分页(每页 20,单页隐藏)');
assert.doesNotMatch(code, /pagination=\{false\}/, '不应再保留 pagination={false}');
assert.match(code, /\.\.\.fixedLeft</, '首列应固定在左侧');
assert.match(code, /\.\.\.fixedRight</, '操作列应固定在右侧');
assert.match(code, /useOverflowGrid\(/, '应按数据量按需开启表内滚动/横向滚动');
});
}