Files
immich-folio/lib/__tests__/siteShape.test.ts
Ralksta ad8b09700b release: v0.19.0
Release v0.19.0. See the `## [0.19.0] — 2026-09-29` section of
[CHANGELOG.md](https://github.com/ralksta/immich-folio/blob/dev/CHANGELOG.md)
for the full list.

Highlights: client proofing links (#683), custom content pages (#738),
asset picker search (#740), concurrent-edit detection (#742), env-locked
settings (#739), an accessibility baseline (#741), three security fixes
with advisories (#737, #755, #759), and a pre-release quality pass
(#780–#797).

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ralksta <ralksta@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Ralf <rohlenbo79@gmail.com>
Co-authored-by: Paul Thies <110185070+ImScheinox@users.noreply.github.com>
Co-authored-by: lancetm714 <108419425+lancetm714@users.noreply.github.com>
Co-authored-by: Lance Martin <lancetaylor95@gmail.com>
2026-09-29 22:50:30 +02:00

49 lines
1.3 KiB
TypeScript

import { describe, it, expect, vi } from 'vitest';
vi.mock('@/lib/config', () => ({
getConfig: () => ({
subpages: [],
standaloneAlbums: [],
aboutEnabled: false,
map: false,
}),
}));
vi.mock('@/lib/immich', () => ({
immich: { getAlbums: async () => [] },
}));
vi.mock('@/lib/auth', () => ({
isProtected: () => false,
isSiteLocked: () => false,
}));
vi.mock('@/lib/admin/journal-service', () => ({
listJournalEntries: async () => [
{ slug: 'open', frontmatter: { title: 'Open' } },
{ slug: 'locked', frontmatter: { title: 'Locked', password: 'scrypt:salt:hash' } },
{ slug: 'wip', frontmatter: { title: 'Draft', draft: true } },
],
}));
vi.mock('@/lib/admin/pages-service', () => ({
listPages: async () => [],
}));
import { buildSiteShape } from '@/lib/siteShape';
import { publicPaths } from '@/lib/publicPages';
describe('buildSiteShape → publicPaths (the sitemap)', () => {
it('lists a public journal entry', async () => {
expect(publicPaths(await buildSiteShape())).toContain('/journal/open');
});
it('leaves out a password-protected journal entry, as /journal does', async () => {
expect(publicPaths(await buildSiteShape())).not.toContain('/journal/locked');
});
it('leaves out a journal draft', async () => {
expect(publicPaths(await buildSiteShape())).not.toContain('/journal/wip');
});
});