Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

docs(test): 设计决定用例的引用改指拆分后的 design-*.test.ts

longmeidaod79e85cadb96
diff --git a/frontend/test/react/activity.test.tsx b/frontend/test/react/activity.test.tsx
index 3b8e7bc0c..ca300d532 100644
--- a/frontend/test/react/activity.test.tsx
+++ b/frontend/test/react/activity.test.tsx
@@ -1,6 +1,6 @@
/* 活动页的行为:三段怎么分、轮询多久一次、失败时留下什么。
*
- * 外观(状态徽章的三档颜色、失败卡的框线)是设计决定,由 `frontend/e2e/design.test.ts`
+ * 外观(状态徽章的三档颜色、失败卡的框线)是设计决定,由 `frontend/e2e/design-*.test.ts`
* 读 `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
diff --git a/frontend/test/react/avatar-picker.test.tsx b/frontend/test/react/avatar-picker.test.tsx
index 4ce70b3b3..a9544e5b9 100644
--- a/frontend/test/react/avatar-picker.test.tsx
+++ b/frontend/test/react/avatar-picker.test.tsx
@@ -1,7 +1,7 @@
/* 换头像:点开之前不取候选,点开之后三条路交什么、换不成时说什么。
*
* 弹层由 React Aria 渲染到挂载容器外面,所以这里的查询都从整页找。
- * 外观(遮罩、网格列数)由 `frontend/e2e/design.test.ts` 读 `getComputedStyle` 断言。 */
+ * 外观(遮罩、网格列数)由 `frontend/e2e/design-*.test.ts` 读 `getComputedStyle` 断言。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
import { afterEach, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/batch-dock.test.tsx b/frontend/test/react/batch-dock.test.tsx
index 95c05ad64..f71b37b2c 100644
--- a/frontend/test/react/batch-dock.test.tsx
+++ b/frontend/test/react/batch-dock.test.tsx
@@ -2,7 +2,7 @@
* (`RESIDENT_ROUTES['batch-dock']`)在路由树里的行为:宿主就是 `[data-batch-dock]`、句柄同步画完、
* 收起与抛错都只卸组件不撤宿主,抛错之后这一面空到刷新为止。
*
- * 浮条的玻璃、位置与窄屏三列栅格要量布局,由 e2e 在浏览器里走(`e2e/design.test.ts`)。 */
+ * 浮条的玻璃、位置与窄屏三列栅格要量布局,由 e2e 在浏览器里走(`e2e/design-*.test.ts`)。 */
import { act } from 'react';
import { createRoot } from 'react-dom/client';
import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/data-cleanup.test.tsx b/frontend/test/react/data-cleanup.test.tsx
index 0758f761d..919a64d87 100644
--- a/frontend/test/react/data-cleanup.test.tsx
+++ b/frontend/test/react/data-cleanup.test.tsx
@@ -2,7 +2,7 @@
*
* 会写真实 ledger 或删盘上东西的那几步(删失效链接、资源同步清理、整理的执行
* 与回滚)都必须先过确认弹层:这里既量「确认了才发」,也量「取消了一个字节都不发」。
- * 外观由 `frontend/e2e/design.test.ts` 读 `getComputedStyle` 断言;这里只看结构、文字与请求。 */
+ * 外观由 `frontend/e2e/design-*.test.ts` 读 `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
import type { ReactElement } from 'react';
import { afterEach, describe, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/entity-hero.test.tsx b/frontend/test/react/entity-hero.test.tsx
index de49b2c3c..3d215926c 100644
--- a/frontend/test/react/entity-hero.test.tsx
+++ b/frontend/test/react/entity-hero.test.tsx
@@ -1,7 +1,7 @@
/* 资料卡岛:名字下面那一行、资料表、外链怎么排;点下去交给壳的是什么;订阅开关成与不成时
* 留下什么;新作那一行的两枚键;「+N」浮层的开合。
*
- * 外观(圆框几何、人脸放大、窄屏单列、浮层位置)由 `frontend/e2e/design.test.ts` 读计算样式断言。 */
+ * 外观(圆框几何、人脸放大、窄屏单列、浮层位置)由 `frontend/e2e/design-*.test.ts` 读计算样式断言。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/entity-page.test.tsx b/frontend/test/react/entity-page.test.tsx
index 22bcfb98e..024ae4c3a 100644
--- a/frontend/test/react/entity-page.test.tsx
+++ b/frontend/test/react/entity-page.test.tsx
@@ -2,7 +2,7 @@
* (`entity-hero`/`entity-filter`/`entity-body.test.tsx`),这里看的是把它们拼成一页的那一层:
* 首屏取哪几样、换筛选重取几次、哪些动作回壳写地址、写操作成功后哪几块跟着更新。
*
- * 骨架换成整页时的几何、吸顶与窄屏横滚由 e2e(`entity-filter.test.ts`、`design.test.ts`)量。 */
+ * 骨架换成整页时的几何、吸顶与窄屏横滚由 e2e(`entity-filter.test.ts`、`design-*.test.ts`)量。 */
import { act, useState } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
import { afterEach, describe, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/follow-detail.test.tsx b/frontend/test/react/follow-detail.test.tsx
index d19dc2541..23d3f9b60 100644
--- a/frontend/test/react/follow-detail.test.tsx
+++ b/frontend/test/react/follow-detail.test.tsx
@@ -1,7 +1,7 @@
/* 关注详情岛:单条取数、侧栏的次序与文案、写操作之后键态怎么变、媒体取不回时退到哪、交给壳与灯箱的是什么。
*
* 从列表进出不重取、舞台在媒体框里挂 Video.js、轮播圆点、恢复带、标签回列表与手机布局要真浏览器,
- * 在 `frontend/e2e/follow-detail.test.ts` 里量;尺寸与色板在 `e2e/design.test.ts`。 */
+ * 在 `frontend/e2e/follow-detail.test.ts` 里量;尺寸与色板在 `e2e/design-*.test.ts`。 */
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
import { afterEach, describe, expect, it, vi, type Mock } from 'vitest';
diff --git a/frontend/test/react/follow-manage.test.tsx b/frontend/test/react/follow-manage.test.tsx
index b2c1b6be8..604333af7 100644
--- a/frontend/test/react/follow-manage.test.tsx
+++ b/frontend/test/react/follow-manage.test.tsx
@@ -1,7 +1,7 @@
/* 关注管理页的行为:按创作者归组、排序作用在全集上、翻页只切最后一步、勾选跨页也跨视图,
* 以及「检查更新」那一趟后台任务什么时候算数。
*
- * 外观(表格的分隔线、徽章档位)是设计决定,由 `frontend/e2e/design.test.ts` 读
+ * 外观(表格的分隔线、徽章档位)是设计决定,由 `frontend/e2e/design-*.test.ts` 读
* `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
diff --git a/frontend/test/react/glow-picker.test.tsx b/frontend/test/react/glow-picker.test.tsx
index 8da156491..c1a6de870 100644
--- a/frontend/test/react/glow-picker.test.tsx
+++ b/frontend/test/react/glow-picker.test.tsx
@@ -1,6 +1,6 @@
/* 侧栏配色卡与它底下那枚配色钮:两组球画什么、点下去写什么,光晕关掉之后卡上剩什么,设置面板那一格改了
* 配色这里当场跟上,以及卡作为常驻面(`RESIDENT_ROUTES['glow-picker']`)由路由树直接画成 `#boardGlowMenu`
- * 的子节点。卡的锚定、开合、玻璃材质与球的像素在真浏览器里量(`e2e/design.test.ts`)。 */
+ * 的子节点。卡的锚定、开合、玻璃材质与球的像素在真浏览器里量(`e2e/design-*.test.ts`)。 */
import { act } from 'react';
import { createRoot } from 'react-dom/client';
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/item-detail.test.tsx b/frontend/test/react/item-detail.test.tsx
index b8b73c936..f31fbf514 100644
--- a/frontend/test/react/item-detail.test.tsx
+++ b/frontend/test/react/item-detail.test.tsx
@@ -1,7 +1,7 @@
/* 作品详情岛:停在队列哪一条、身份与标签怎么分组、首屏要转去哪、交给壳的是什么、写完之后缓存与回执怎么变。
*
* 从目录进出不重取、舞台在媒体框里挂 Video.js、脱盘说明、四种队列、拖动排序、保存 Mix、接着看与手机
- * 布局要真浏览器,在 `frontend/e2e/item-detail.test.ts` 里量;尺寸与色板在 `e2e/design.test.ts`。 */
+ * 布局要真浏览器,在 `frontend/e2e/item-detail.test.ts` 里量;尺寸与色板在 `e2e/design-*.test.ts`。 */
import { notifyManager, QueryClientProvider, type InfiniteData } from '@tanstack/react-query';
import { act } from 'react';
import { afterEach, describe, expect, it, vi, type Mock } from 'vitest';
diff --git a/frontend/test/react/library-processing.test.tsx b/frontend/test/react/library-processing.test.tsx
index 0da3741c7..90a8de906 100644
--- a/frontend/test/react/library-processing.test.tsx
+++ b/frontend/test/react/library-processing.test.tsx
@@ -2,7 +2,7 @@
*
* 一份快照有两个读者——数据管理页那张卡片和目录页顶上那条横幅。它们读同一个 `queryKey`,
* 所以这里既量单独一处的行为,也量两处同时在场时的请求数。
- * 外观(横幅的语气底色、页脚按钮的主次)由 `frontend/e2e/design.test.ts` 读
+ * 外观(横幅的语气底色、页脚按钮的主次)由 `frontend/e2e/design-*.test.ts` 读
* `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
diff --git a/frontend/test/react/quality-goals.test.tsx b/frontend/test/react/quality-goals.test.tsx
index 5f612486c..aff4c3d7a 100644
--- a/frontend/test/react/quality-goals.test.tsx
+++ b/frontend/test/react/quality-goals.test.tsx
@@ -1,6 +1,6 @@
/* 高清版目标页的行为:一张卡上有什么、点哪里打开作品、进出这一页各发几次请求。
*
- * 外观(封面的宽度与比例、长标题的中间省略)是设计决定,由 `frontend/e2e/design.test.ts`
+ * 外观(封面的宽度与比例、长标题的中间省略)是设计决定,由 `frontend/e2e/design-*.test.ts`
* 读 `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
import { afterEach, expect, it, vi } from 'vitest';
diff --git a/frontend/test/react/review.test.tsx b/frontend/test/react/review.test.tsx
index bb7f547ea..754b9250b 100644
--- a/frontend/test/react/review.test.tsx
+++ b/frontend/test/react/review.test.tsx
@@ -1,7 +1,7 @@
/* 人工复核页的行为:分类是地址栏上的身份,分组筛选分页是这一刻的看法,判定只改缓存里
* 那几行,以及只读账本上这一页什么都不写。
*
- * 外观(卡片底色、页签选中态)是设计决定,由 `frontend/e2e/design.test.ts` 读
+ * 外观(卡片底色、页签选中态)是设计决定,由 `frontend/e2e/design-*.test.ts` 读
* `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
diff --git a/frontend/test/react/scraping.test.tsx b/frontend/test/react/scraping.test.tsx
index 0e2047b23..0f2e6e4aa 100644
--- a/frontend/test/react/scraping.test.tsx
+++ b/frontend/test/react/scraping.test.tsx
@@ -1,6 +1,6 @@
/* 来源和凭证页的行为:交什么、清什么、结果怎么说、后台那一趟跟到什么时候。
*
- * 外观(页脚三键的主次、来源外链的 `rel`)是设计决定,由 `frontend/e2e/design.test.ts`
+ * 外观(页脚三键的主次、来源外链的 `rel`)是设计决定,由 `frontend/e2e/design-*.test.ts`
* 读 `getComputedStyle` 断言;这里只看结构、文字与请求。 */
import { act } from 'react';
import { notifyManager, QueryClientProvider } from '@tanstack/react-query';
diff --git a/frontend/test/react/settings-panel.test.tsx b/frontend/test/react/settings-panel.test.tsx
index 117374cf4..dd8e992a3 100644
--- a/frontend/test/react/settings-panel.test.tsx
+++ b/frontend/test/react/settings-panel.test.tsx
@@ -2,7 +2,7 @@
* 拉条拖动中只排重画、松手才落盘,面板 DOM 只建一次;以及它作为常驻面(`RESIDENT_ROUTES['settings-panel']`)
* 在路由树里的行为:宿主 `[data-settings-host]` 第一次打开时放进 body 末尾、不包 `.peach-react`,画上之后句柄
* 才交出,`open` 返回时面板已经画好,抛错只卸组件。开合动效、焦点圈、写接口与像素在真浏览器里验,见
- * `e2e/settings-panel.test.ts` 与 `e2e/design.test.ts`。 */
+ * `e2e/settings-panel.test.ts` 与 `e2e/design-*.test.ts`。 */
import { act } from 'react';
import { createRoot } from 'react-dom/client';
import { notifyManager } from '@tanstack/react-query';
diff --git a/frontend/test/react/stats.test.tsx b/frontend/test/react/stats.test.tsx
index fce44ac4f..9d82a7b71 100644
--- a/frontend/test/react/stats.test.tsx
+++ b/frontend/test/react/stats.test.tsx
@@ -1,7 +1,7 @@
/* 统计页的行为:一屏读的是不是同一份数、四张卡当页签切到哪一层、几个空态去哪、
* 点内容标签交回给壳的是哪个键、图表的分档怎么折算。
*
- * 外观(卡片间距、阴影)是设计决定,由 `frontend/e2e/design.test.ts` 读
+ * 外观(卡片间距、阴影)是设计决定,由 `frontend/e2e/design-*.test.ts` 读
* `getComputedStyle` 断言;这里只看结构、文字与请求。Recharts 在这里量不到容器尺寸,
* 画不出图形本身,图的读数从图例、页头与纯函数上验。 */
import { act } from 'react';
diff --git a/frontend/test/react/taste.test.tsx b/frontend/test/react/taste.test.tsx
index b113a61fa..805d5b066 100644
--- a/frontend/test/react/taste.test.tsx
+++ b/frontend/test/react/taste.test.tsx
@@ -1,7 +1,7 @@
/* 口味页的行为:两套证据怎么切、换范围时那一屏还在不在、后台那一趟什么时候算数、
* 导入与移除各自走哪条路、点名次交回去的是什么。
*
- * 外观(雷达图的网格、热力格的浓度档)是设计决定,由 `frontend/e2e/design.test.ts` 读
+ * 外观(雷达图的网格、热力格的浓度档)是设计决定,由 `frontend/e2e/design-*.test.ts` 读
* `getComputedStyle` 断言;这里只看结构、文字与请求。Recharts 在这里量不到容器尺寸,
* 整页挂上去时雷达与排行条的图形画不出来,从外层的名字与纯函数上验;雷达的刻度用例单挂
* 这张图,拿掉 `ResizeObserver` 让它按初始尺寸画。 */
diff --git a/tests/test_source_assertion_ratchet.py b/tests/test_source_assertion_ratchet.py
index d4a638da2..7e2186e4d 100644
--- a/tests/test_source_assertion_ratchet.py
+++ b/tests/test_source_assertion_ratchet.py
@@ -9,7 +9,7 @@
要守的东西换成能跑的验收:
- 行为(点了提交什么、状态怎么变、算出什么值)写 vitest(`frontend/test/`)或
`tests/test_web_js.py`,后端写调用真函数或真接口的测试;
-- 用户定过的设计决定写 `frontend/e2e/design.test.ts`,读 `getComputedStyle`;
+- 用户定过的设计决定写 `frontend/e2e/design-*.test.ts`,读 `getComputedStyle`;
- 布局与运行期不变量进 `frontend/e2e/smoke.test.ts`;
- 全仓都该成立的写法约定写成扫描器或 lint(如 `test_complexity_ratchet.py`),
一条规则一个检查,而不是一处写法一条断言。
diff --git a/web/css/12-cards.css b/web/css/12-cards.css
index abb2586c0..ab663107c 100644
--- a/web/css/12-cards.css
+++ b/web/css/12-cards.css
@@ -82,7 +82,7 @@ main{position:relative;z-index:1;padding:14px 16px 90px}
跳过渲染连带 paint containment,裁切边是元信息区的 padding box:贴着左缘的头像悬停
描边、头像与标签的 2px 焦点环都画在内容盒外面。所以元信息区四周垫 8px 内边距、再用
-8px 外边距抵消,裁切边往外扩 8px(和整张卡的悬停面同宽),内容盒、卡片尺寸和它与
- 封面的间距一个像素不动;`frontend/e2e/design.test.ts` 按几何检查岛里的同一写法。垫出来的那一圈伸到
+ 封面的间距一个像素不动;`frontend/e2e/design-*.test.ts` 按几何检查岛里的同一写法。垫出来的那一圈伸到
卡片盒外面,元信息区自己因此不接指针,只有它的子元素接:卡片的悬停面、点击区和悬停
预览的触发范围仍是卡片盒本身。元信息区没有背景,垫出来的一圈不画任何东西。
图片墙不在其内:它的封面没有固定比例,高度取自图片本身,跳过渲染时会按零高排版。