Skip to content

Commit 37e50f0

Browse files
merphxopencode
andcommitted
test: move nested-emphasis+ADF tests to adf-passthrough 🧩
- Relocate two intersection tests (nested emphasis containing inline ADF nodes) from core-markdown.test.ts to adf-passthrough.test.ts where they better reflect the feature under test - Retain the four pure nested-emphasis tests in core-markdown.test.ts as they cover cases not present in pre-existing fixture-based tests Co-Authored-By: opencode <noreply@opencode.ai>
1 parent d478afc commit 37e50f0

2 files changed

Lines changed: 53 additions & 53 deletions

File tree

lib/test/adf-passthrough.test.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,59 @@ test("passes through multiple inline ADF nodes inside bold text", (t) => {
362362
});
363363
});
364364

365+
// --- nested emphasis with inline ADF ---
366+
367+
test("bold span containing both italic text and an inline ADF node", (t) => {
368+
const mention = {
369+
type: "mention",
370+
attrs: { id: "abc-123", text: "@Alice", accessLevel: "APPLICATION" },
371+
};
372+
t.deepEqual(
373+
markdownToAdf(
374+
`**contact _Alice_ aka <adf>${JSON.stringify(mention)}</adf>**`,
375+
),
376+
{
377+
version: 1,
378+
type: "doc",
379+
content: [
380+
{
381+
type: "paragraph",
382+
content: [
383+
{ type: "text", text: "contact ", marks: [{ type: "strong" }] },
384+
{
385+
type: "text",
386+
text: "Alice",
387+
marks: [{ type: "strong" }, { type: "em" }],
388+
},
389+
{ type: "text", text: " aka ", marks: [{ type: "strong" }] },
390+
mention,
391+
],
392+
},
393+
],
394+
},
395+
);
396+
});
397+
398+
test("inline ADF node inside italic text that is itself inside bold text", (t) => {
399+
const date = { type: "date", attrs: { timestamp: "1777852800000" } };
400+
t.deepEqual(
401+
markdownToAdf(`**returning _<adf>${JSON.stringify(date)}</adf>_**`),
402+
{
403+
version: 1,
404+
type: "doc",
405+
content: [
406+
{
407+
type: "paragraph",
408+
content: [
409+
{ type: "text", text: "returning ", marks: [{ type: "strong" }] },
410+
date,
411+
],
412+
},
413+
],
414+
},
415+
);
416+
});
417+
365418
// --- marked singleton isolation ---
366419

367420
test("importing marklassian does not affect marked.parse() HTML output", (t) => {

lib/test/core-markdown.test.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -250,56 +250,3 @@ test("strikethrough text containing bold produces both marks on the inner text",
250250
],
251251
});
252252
});
253-
254-
// --- nested emphasis with inline ADF ---
255-
256-
test("bold span containing both italic text and an inline ADF node", (t) => {
257-
const mention = {
258-
type: "mention",
259-
attrs: { id: "abc-123", text: "@Alice", accessLevel: "APPLICATION" },
260-
};
261-
t.deepEqual(
262-
markdownToAdf(
263-
`**contact _Alice_ aka <adf>${JSON.stringify(mention)}</adf>**`,
264-
),
265-
{
266-
version: 1,
267-
type: "doc",
268-
content: [
269-
{
270-
type: "paragraph",
271-
content: [
272-
{ type: "text", text: "contact ", marks: [{ type: "strong" }] },
273-
{
274-
type: "text",
275-
text: "Alice",
276-
marks: [{ type: "strong" }, { type: "em" }],
277-
},
278-
{ type: "text", text: " aka ", marks: [{ type: "strong" }] },
279-
mention,
280-
],
281-
},
282-
],
283-
},
284-
);
285-
});
286-
287-
test("inline ADF node inside italic text that is itself inside bold text", (t) => {
288-
const date = { type: "date", attrs: { timestamp: "1777852800000" } };
289-
t.deepEqual(
290-
markdownToAdf(`**returning _<adf>${JSON.stringify(date)}</adf>_**`),
291-
{
292-
version: 1,
293-
type: "doc",
294-
content: [
295-
{
296-
type: "paragraph",
297-
content: [
298-
{ type: "text", text: "returning ", marks: [{ type: "strong" }] },
299-
date,
300-
],
301-
},
302-
],
303-
},
304-
);
305-
});

0 commit comments

Comments
 (0)