162abdc97c
- Add Prettier 3 with prettier-plugin-organize-imports (sorts/removes unused imports) - Add ESLint 10 flat config with typescript-eslint + eslint-plugin-vue + eslint-config-prettier - Add root scripts: format, format:check, lint, lint:fix - Reformat 257 files across admin-web, ops-web, desktop-client, packages - Remove unused locals/exports flagged by --noUnusedLocals/--noUnusedParameters - Fix duplicate localTabLabel key, surrogate-pair regex u-flag, NBSP literal in regex - Skip server/ (Go) and apps/browser-extension/ (deprecated per ADR) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { isReclaimableHiddenPlaywrightTarget } from './playwright-cdp-targets'
|
|
|
|
describe('playwright cdp target pruning', () => {
|
|
it('does not reclaim blank app-owned page targets', () => {
|
|
expect(
|
|
isReclaimableHiddenPlaywrightTarget({
|
|
id: 'main-window-host',
|
|
type: 'page',
|
|
title: '',
|
|
url: '',
|
|
}),
|
|
).toBe(false)
|
|
})
|
|
|
|
it('only reclaims targets marked as hidden Playwright pages', () => {
|
|
expect(
|
|
isReclaimableHiddenPlaywrightTarget({
|
|
id: 'hidden-window',
|
|
type: 'page',
|
|
title: '监控任务 · hidden-playwright',
|
|
url: 'data:text/html;charset=utf-8,%3Cmeta%20name%3D%22geo-hidden-playwright-token%22%3E',
|
|
}),
|
|
).toBe(true)
|
|
})
|
|
|
|
it('ignores regular user-visible browser targets', () => {
|
|
expect(
|
|
isReclaimableHiddenPlaywrightTarget({
|
|
id: 'renderer',
|
|
type: 'page',
|
|
title: '省心推 - 账号健康监控与内容发布平台',
|
|
url: 'http://localhost:5173/',
|
|
}),
|
|
).toBe(false)
|
|
})
|
|
})
|