Skip to content

Commit

Permalink
chore: remove tests in renderer-hir
Browse files Browse the repository at this point in the history
  • Loading branch information
bachbui committed Nov 13, 2024
1 parent ebd358d commit 70afbe7
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions packages/@atjson/renderer-hir/test/renderer-hir.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,67 +468,5 @@ describe("@atjson/renderer-hir", () => {
"This document has a spoiler:\nXXXXXXXXXX"
);
});

test("nested slices and subsequent marks", () => {
let atjson = new TestSource({
content: "Pre-text\n\nParent Slice\n\nChild Slice\n\nPost-text",
annotations: [
new Italic({ start: 0, end: 3 }),
new SliceAnnotation({ id: "slice1", start: 10, end: 37 }),
new SliceAnnotation({ id: "slide2", start: 24, end: 30 }),
new Bold({ start: 37, end: 41 }),
],
});

class ConcreteRenderer extends Renderer {
*Bold() {
let text = (yield).join("");
return `__${text}__`;
}
*Italic() {
let text = (yield).join("");
return `*${text}*`;
}
*root() {
let results = (yield).join("");
return results;
}
}

expect(ConcreteRenderer.render(atjson)).toEqual(
"*Pre*-text\n\n__Post__-text"
);
});

test("overlapping slices and subsequent marks", () => {
let atjson = new TestSource({
content: "Pre-text\n\nParent Slice\n\nChild Slice\n\nPost-text",
annotations: [
new Italic({ start: 0, end: 3 }),
new SliceAnnotation({ id: "slice1", start: 10, end: 30 }),
new SliceAnnotation({ id: "slide2", start: 24, end: 37 }),
new Bold({ start: 37, end: 41 }),
],
});

class ConcreteRenderer extends Renderer {
*Bold() {
let text = (yield).join("");
return `__${text}__`;
}
*Italic() {
let text = (yield).join("");
return `*${text}*`;
}
*root() {
let results = (yield).join("");
return results;
}
}

expect(ConcreteRenderer.render(atjson)).toEqual(
"*Pre*-text\n\n__Post__-text"
);
});
});
});

0 comments on commit 70afbe7

Please sign in to comment.