Skip to content

Commit

Permalink
Add test for rendering with html
Browse files Browse the repository at this point in the history
  • Loading branch information
iruszpel committed Sep 6, 2023
1 parent fe589f4 commit 7d1ae50
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/pdf-renderer/src/lib/reactRenderer.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ describe("ReactRendererService", () => {
expect($(`[data-styled="true"]`).html()?.includes("height:10px;")).toBeTruthy();
});
});

describe("generate html with header and footer", () => {
it("should generate html with header and footer", () => {
const html = service.generateWithHeaderAndFooter(
React.createElement("div"),
React.createElement("div"),
React.createElement("div"),
[],
);

const $ = cheerio.load(html);

expect($(`header`).length).toBeGreaterThan(0);
expect($(`footer`).length).toBeGreaterThan(0);
});
});
});

const StyledDiv = styled.div`
Expand Down

0 comments on commit 7d1ae50

Please sign in to comment.