阶段十:完成注释门禁最终验收
This commit is contained in:
1 parent
d1a165f897
commit
f30a1f68f8
29 files changed
+509
-7253
No files matched your search
@@ -2,27 +2,27 @@ import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
const source = (path: string) => readFileSync(resolve(__dirname, path), 'utf8');
|
||||
const source = (path: string) => readFileSync(resolve(__dirname, path), 'utf8'); /* source 表示source。 */
|
||||
|
||||
describe('responsive rules layout', () => {
|
||||
test('allows the rules page to shrink inside the sidebar layout', () => {
|
||||
const app = source('App.tsx');
|
||||
const rules = source('components/Rules.tsx');
|
||||
const app = source('App.tsx'); /* app 表示app。 */
|
||||
const rules = source('components/Rules.tsx'); /* rules 表示规则集合。 */
|
||||
expect(app).toContain('h-screen min-w-0 flex-1 overflow-x-hidden');
|
||||
expect(rules).toContain('min-w-0 space-y-8');
|
||||
expect(rules).toContain('xl:grid-cols-[minmax(270px,0.72fr)_minmax(0,1.28fr)]');
|
||||
expect(rules).not.toContain('2xl:grid-cols-[360px_1fr]');
|
||||
});
|
||||
});
|
||||
} /* 回调函数负责当前业务流程。 */);
|
||||
} /* 回调函数负责当前业务流程。 */);
|
||||
|
||||
describe('rules summary counts', () => {
|
||||
test('uses server-side aggregate counts instead of the current page length', () => {
|
||||
const rules = source('components/Rules.tsx');
|
||||
const api = source('services/api.ts');
|
||||
const rules = source('components/Rules.tsx'); /* rules 表示规则集合。 */
|
||||
const api = source('services/api.ts'); /* api 表示api。 */
|
||||
expect(rules).toContain('automationTriggerCounts');
|
||||
expect(rules).toContain('{automationTriggerCounts[trigger] || 0}');
|
||||
expect(rules).toContain('筛选结果构成');
|
||||
expect(rules).not.toContain('rulesByTrigger[trigger].length');
|
||||
expect(api).toContain('trigger_counts');
|
||||
});
|
||||
});
|
||||
} /* 回调函数负责当前业务流程。 */);
|
||||
} /* 回调函数负责当前业务流程。 */);
|
||||
Reference in new issue
Block a user