Files
klz-cables.com/tests/lexical.test.ts
Marc Mintel 0554460153
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 10s
Build & Deploy / 🧪 QA (push) Failing after 52s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
fix(products): extract lexical AST and JSON-LD data correctly from productTabs block
2026-08-07 17:12:55 +02:00

28 lines
700 B
TypeScript

import { describe, it, expect } from 'vitest';
import { lexicalToMarkdown } from '../lib/mdx-utils';
describe('lexicalToMarkdown', () => {
it('should convert lexical AST to markdown', () => {
const ast = {
type: 'root',
children: [
{
type: 'paragraph',
children: [
{ type: 'text', text: 'Hello ' },
{ type: 'text', text: 'World', format: 1 }, // bold
],
},
{
type: 'heading',
tag: 'h2',
children: [{ type: 'text', text: 'Title' }],
},
],
};
const result = lexicalToMarkdown(ast);
expect(result).toBe('Hello **World**\n\n## Title\n\n');
});
});