mirror of
https://github.com/nianzhibai/91.git
synced 2026-06-15 00:44:30 +08:00
811d87cc27
- 重写添加/编辑爬虫弹窗布局,优化桌面宽度、脚本来源与测试区域比例,并隐藏本地路径/导入 URL 等内部信息。 - 调整爬虫管理页文案和移动端统计卡片布局,统一状态卡片两列展示,避免弹窗点击遮罩误关闭。 - 支持 GitHub blob 链接自动转换为 raw 链接,提升通过 URL 导入脚本的兼容性。 - 为脚本爬虫下载结果增加 ffprobe 完整性校验,失败时删除坏文件且不写入 seen,允许后续重新抓取。 - 支持 .m3u8/HLS 媒体通过 ffmpeg 重新封装为本地 MP4,并继续走指纹、封面、预览和上传迁移流程。 - 修复 dry-run stderr 日志偶发丢失问题,并补充 GitHub URL、坏视频清理、HLS 下载、弹窗交互和响应式布局测试。
24 lines
939 B
TypeScript
24 lines
939 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
const modalSource = readFileSync(
|
|
new URL("../src/admin/Modal.tsx", import.meta.url),
|
|
"utf8"
|
|
);
|
|
|
|
test("admin modal does not reset focus when close handler identity changes", () => {
|
|
assert.match(modalSource, /const onCloseRef = useRef\(onClose\);/);
|
|
assert.match(modalSource, /onCloseRef\.current = onClose;/);
|
|
assert.match(modalSource, /onCloseRef\.current\(\);/);
|
|
assert.match(modalSource, /window\.clearTimeout\(focusTimer\);/);
|
|
assert.match(modalSource, /\}, \[open\]\);/);
|
|
assert.doesNotMatch(modalSource, /\}, \[open, onClose\]\);/);
|
|
});
|
|
|
|
test("admin modal backdrop clicks do not close dialogs", () => {
|
|
assert.match(modalSource, /className="admin-modal-backdrop"/);
|
|
assert.doesNotMatch(modalSource, /onMouseDown=\{\(e\) =>/);
|
|
assert.doesNotMatch(modalSource, /e\.target === e\.currentTarget/);
|
|
});
|