refactor: extract settings portal modals

This commit is contained in:
Cita
2026-03-23 13:18:37 +08:00
parent f7a7084278
commit 62eca41bc2
5 changed files with 429 additions and 284 deletions
@@ -0,0 +1,12 @@
import { describe, expect, it } from 'vitest';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
describe('Settings factory reset modal extraction', () => {
it('delegates the destructive factory reset portal to a dedicated settings component', () => {
const source = readFileSync(resolve(process.cwd(), 'src/web/pages/Settings.tsx'), 'utf8').replace(/\r\n/g, '\n');
expect(source).toContain("import FactoryResetModal from './settings/FactoryResetModal.js'");
expect(source).not.toContain('{factoryResetPresence.shouldRender && (() => {');
});
});