fix: make sitemap work properly

This commit is contained in:
hugo committed 2026-02-19 09:40:12 +01:00
1 parent 623aab62c3
commit b410736a67
7 files changed
+389 -81

No files matched your search

@@ -43,8 +43,8 @@ describe('SettingsView Diff Preferences', () => {
meta: {
...(window as any).electronAPI?.meta,
getCategories: vi.fn().mockResolvedValue(['article', 'picture', 'aside', 'page']),
getProjectMetadata: vi.fn().mockResolvedValue({ maxPostsPerPage: 75 }),
updateProjectMetadata: vi.fn().mockResolvedValue({ maxPostsPerPage: 12 }),
getProjectMetadata: vi.fn().mockResolvedValue({ maxPostsPerPage: 75, publicUrl: 'https://example.com' }),
updateProjectMetadata: vi.fn().mockResolvedValue({ maxPostsPerPage: 12, publicUrl: 'https://example.com' }),
},
chat: {
...(window as any).electronAPI?.chat,
@@ -92,4 +92,19 @@ describe('SettingsView Diff Preferences', () => {
expect.objectContaining({ maxPostsPerPage: 75 })
);
});
it('includes project public URL in metadata save payload', async () => {
render(<SettingsView />);
await screen.findByDisplayValue('https://example.com');
const saveButton = screen.getByRole('button', { name: /save project settings/i });
fireEvent.click(saveButton);
await new Promise((resolve) => setTimeout(resolve, 0));
expect((window as any).electronAPI.meta.updateProjectMetadata).toHaveBeenCalledWith(
expect.objectContaining({ publicUrl: 'https://example.com' })
);
});
});