Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesRudolph committed Jan 31, 2022
1 parent 47b11eb commit 088a1a6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/RichTextRenderer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Annotations, RichText } from '@notionhq/client/build/src/api-types';

import { RenderingLoggingContext } from './logger';
import { RichTextRenderer } from './RichTextRenderer';

function annotations(x: Partial<Annotations>): Annotations {
Expand All @@ -13,6 +14,9 @@ function annotations(x: Partial<Annotations>): Annotations {
...x,
};
}

const context = new RenderingLoggingContext('');

describe("RichTextRenderer", () => {
let sut: RichTextRenderer;
let linkRenderer: typeof jest;
Expand Down Expand Up @@ -60,7 +64,7 @@ describe("RichTextRenderer", () => {
},
];

const result = await sut.renderMarkdown(text);
const result = await sut.renderMarkdown(text, context);

expect(result).toEqual("**Hello** World.");
});
Expand All @@ -85,7 +89,7 @@ describe("RichTextRenderer", () => {
},
];

const result = await sut.renderMarkdown(text);
const result = await sut.renderMarkdown(text, context);

expect(result).toEqual("Hello **World.**");
});
Expand All @@ -110,7 +114,7 @@ describe("RichTextRenderer", () => {
},
];

const result = await sut.renderMarkdown(text);
const result = await sut.renderMarkdown(text, context);

expect(result).toEqual(" ***Hello*** **World.**");
});
Expand All @@ -135,7 +139,7 @@ describe("RichTextRenderer", () => {
},
];

const result = await sut.renderMarkdown(text);
const result = await sut.renderMarkdown(text, context);

expect(result).toEqual("**Hello** \n\tWorld\n");
});
Expand Down

0 comments on commit 088a1a6

Please sign in to comment.