mirror of
https://github.com/stablyai/orca.git
synced 2026-10-18 08:03:22 +00:00
25 lines
719 B
TypeScript
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('')).toEqual([
|
|
{
|
|
type: 'image',
|
|
alt: 'Screenshot',
|
|
url: 'https://example.com/screen.png'
|
|
}
|
|
])
|
|
})
|
|
})
|