Files
orca/mobile/src/components/MobileMarkdown.test.ts
2026-05-21 20:26:07 -07:00

25 lines
719 B
TypeScript

import { describe, expect, it } from 'vitest'
import { parseMobileMarkdown } from './mobile-markdown-parser'
describe('parseMobileMarkdown', () => {
it('parses GFM tables into table blocks', () => {
expect(parseMobileMarkdown('| Name | State |\n| --- | --- |\n| Orca | Open |')).toEqual([
{
type: 'table',
headers: ['Name', 'State'],
rows: [['Orca', 'Open']]
}
])
})
it('parses standalone HTTPS images without folding them into paragraphs', () => {
expect(parseMobileMarkdown('![Screenshot](https://example.com/screen.png)')).toEqual([
{
type: 'image',
alt: 'Screenshot',
url: 'https://example.com/screen.png'
}
])
})
})