test(storyreader): verify person chip link meets 44px touch-target height
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 2m57s
CI / OCR Service Tests (pull_request) Successful in 23s
CI / Backend Unit Tests (pull_request) Successful in 3m46s
CI / fail2ban Regex (pull_request) Successful in 46s
CI / Semgrep Security Scan (pull_request) Successful in 22s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m6s
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 2m57s
CI / OCR Service Tests (pull_request) Successful in 23s
CI / Backend Unit Tests (pull_request) Successful in 3m46s
CI / fail2ban Regex (pull_request) Successful in 46s
CI / Semgrep Security Scan (pull_request) Successful in 22s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m6s
Mirrors the getBoundingClientRect pattern from JourneyItemCard.svelte.spec.ts. Tests actual rendered height rather than presence of a CSS class string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,22 @@ describe('StoryReader', () => {
|
|||||||
expect(ondelete).toHaveBeenCalledOnce();
|
expect(ondelete).toHaveBeenCalledOnce();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('person chip link meets 44px touch-target minimum height', async () => {
|
||||||
|
render(StoryReader, {
|
||||||
|
context: ctx(),
|
||||||
|
props: {
|
||||||
|
geschichte: baseGeschichte({
|
||||||
|
persons: [{ id: 'p1', firstName: 'Helene', lastName: 'Schmidt' }]
|
||||||
|
}),
|
||||||
|
canBlogWrite: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const link = document.querySelector<HTMLAnchorElement>('a[href^="/persons/"]');
|
||||||
|
const rect = link?.getBoundingClientRect();
|
||||||
|
expect(rect?.height).toBeGreaterThanOrEqual(44);
|
||||||
|
});
|
||||||
|
|
||||||
it('XSS: Story body is sanitised — injected payload does not execute', async () => {
|
it('XSS: Story body is sanitised — injected payload does not execute', async () => {
|
||||||
// StoryReader uses {@html safeHtml(g.body)} — DOMPurify must strip the payload.
|
// StoryReader uses {@html safeHtml(g.body)} — DOMPurify must strip the payload.
|
||||||
render(StoryReader, {
|
render(StoryReader, {
|
||||||
|
|||||||
Reference in New Issue
Block a user