chore: phase 2 and 3 refactors

This commit is contained in:
2026-02-21 18:02:20 +01:00
parent 40892b9302
commit 87200a8ad9
24 changed files with 411 additions and 74 deletions

View File

@@ -0,0 +1,27 @@
import { describe, expect, it } from 'vitest';
import type { SiteValidationReport } from '../../../src/main/shared/electronApi';
import {
getPersistedSiteValidationReport,
persistSiteValidationReport,
} from '../../../src/renderer/navigation/siteValidationPersistence';
const report: SiteValidationReport = {
sitemapPath: '/tmp/sitemap.xml',
sitemapChanged: false,
missingUrlPaths: ['/foo'],
extraUrlPaths: ['/bar'],
expectedUrlCount: 10,
existingHtmlUrlCount: 9,
};
describe('siteValidationPersistence', () => {
it('persists and loads site validation report by project', () => {
persistSiteValidationReport('project-1', report);
expect(getPersistedSiteValidationReport('project-1')).toEqual(report);
});
it('returns null when project has no persisted report', () => {
expect(getPersistedSiteValidationReport('missing-project')).toBeNull();
});
});