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>
This commit is contained in:
53
lib/__tests__/slug-field.test.ts
Normal file
53
lib/__tests__/slug-field.test.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { isValidSlug, sanitizeSlug, slugFieldValue } from '../journal';
|
||||
|
||||
/** What a controlled slug input shows after each keystroke of `text`. */
|
||||
function typeInto(text: string): string {
|
||||
let value = '';
|
||||
for (const ch of text) value = slugFieldValue(value + ch);
|
||||
return value;
|
||||
}
|
||||
|
||||
describe('slugFieldValue — a slug field while it is typed', () => {
|
||||
it('lets a hyphen be typed between two words', () => {
|
||||
// sanitizeSlug() on every keystroke dropped the trailing "-", so the next
|
||||
// letter was glued on: "about-us" came out as "aboutus".
|
||||
expect(typeInto('about-us')).toBe('about-us');
|
||||
expect(typeInto('about us')).toBe('about-us');
|
||||
});
|
||||
|
||||
it('can be emptied instead of jumping to "untitled"', () => {
|
||||
expect(slugFieldValue('')).toBe('');
|
||||
});
|
||||
|
||||
it('still refuses what a slug cannot hold', () => {
|
||||
expect(slugFieldValue('Preise & Pakete!')).toBe('preise-pakete-');
|
||||
expect(slugFieldValue('--a//b')).toBe('a-b');
|
||||
});
|
||||
|
||||
it('becomes the stored slug through sanitizeSlug()', () => {
|
||||
for (const input of ['about-', 'About Us ', ' a--b ', 'x_y']) {
|
||||
const finished = sanitizeSlug(slugFieldValue(input));
|
||||
expect(finished).toBe(sanitizeSlug(input));
|
||||
expect(isValidSlug(finished)).toBe(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('sanitizeSlug — accented letters', () => {
|
||||
it('keeps the base letter instead of splitting the word', () => {
|
||||
// "für" used to become "f-r": every non-ASCII letter turned into a hyphen.
|
||||
expect(sanitizeSlug('Preise für Hochzeiten')).toBe('preise-fur-hochzeiten');
|
||||
expect(sanitizeSlug('Über mich')).toBe('uber-mich');
|
||||
expect(sanitizeSlug('Café Olé')).toBe('cafe-ole');
|
||||
expect(sanitizeSlug('Straße')).toBe('strasse');
|
||||
});
|
||||
|
||||
it('agrees with the slug field', () => {
|
||||
expect(typeInto('Über mich')).toBe('uber-mich');
|
||||
});
|
||||
|
||||
it('still falls back for a title without any Latin letter', () => {
|
||||
expect(sanitizeSlug('家族')).toBe('untitled');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user