Files
supabase/apps/docs/lib/md-to-plain-text.test.ts
Anthony Lio 42f1401769 fix(ui-patterns): a11y accessible names for ExpandableVideo (#50226)
## What kind of change does this PR introduce?

bug fix a11y `ExapndableVideo` 

## What is the current behavior?

`ExpandableVideo` blurred thumbnail has `alt="Video guide preview"`
sitting behind an overlay that already reads "Watch video guide" making
screen readers announcing the same thing twice

## What is the new behavior?

- adds an optional `videoTitle` prop that names the video once and feeds
both the button's `aria-label` and the player's `title`.

## Test
1. visit `/docs/guides/functions`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Enhancements**
  - Video previews in guides now display the relevant guide title.
  - Partner introduction videos now include a descriptive title.
- Video controls and embedded players provide more specific
accessibility labels when titles are available.
- Preview images without meaningful alternative text are treated as
decorative to reduce redundant screen-reader output.
- **Bug Fixes**
- Guide titles with Markdown formatting now appear as clean, readable
text in video labels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-11 23:37:52 +03:00

16 lines
468 B
TypeScript

import { describe, expect, it } from 'vitest'
import { mdToPlainText } from './md-to-plain-text'
describe('mdToPlainText', () => {
it('strips code spans from a real title', () => {
expect(mdToPlainText('Handling errors in `supabase-js`')).toBe('Handling errors in supabase-js')
})
it('keeps underscores in extension names', () => {
expect(mdToPlainText('pg_cron: Schedule Recurring Jobs')).toBe(
'pg_cron: Schedule Recurring Jobs'
)
})
})