6caa376f82
* feat(reader): make fixed-layout scroll gap configurable (foliate-js bump) (#3647) * feat(reader): add webtoonMode view setting + scroll-gap helper (#3647) * feat(reader): Webtoon Mode toggle in the fixed-layout view menu (#3647) * feat(reader): apply Webtoon Mode gap on fixed-layout book open (#3647) * fix(reader): clear Webtoon Mode + reset gap when Shift+J leaves scrolled (#3647) * chore(i18n): translate Webtoon Mode string across locales (#3647) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(deps): bump foliate-js to merged readest/foliate-js#30 (#3647) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
644 B
TypeScript
19 lines
644 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { scrollGapToCss } from 'foliate-js/fixed-layout.js';
|
|
|
|
describe('scrollGapToCss', () => {
|
|
it('maps a non-negative number string to a px length', () => {
|
|
expect(scrollGapToCss('0')).toBe('0px');
|
|
expect(scrollGapToCss('4')).toBe('4px');
|
|
expect(scrollGapToCss('12')).toBe('12px');
|
|
});
|
|
|
|
it('returns null for empty / invalid / negative / null so the CSS fallback (4px) applies', () => {
|
|
expect(scrollGapToCss('')).toBeNull();
|
|
expect(scrollGapToCss('abc')).toBeNull();
|
|
expect(scrollGapToCss('-2')).toBeNull();
|
|
expect(scrollGapToCss(null)).toBeNull();
|
|
});
|
|
});
|