test: finialized test coverage for pdf definitions

This commit is contained in:
Jacobtread 2026-04-14 20:19:05 +12:00
parent aaa93c3371
commit fbb361bc41
2 changed files with 20 additions and 4 deletions

View file

@ -280,6 +280,26 @@ describe("createPdfDefinition", () => {
expect(table.body.length).toBe(2);
});
it("padding should be defined", () => {
const timekeep: Timekeep = {
entries: [],
} as Timekeep;
const settings = createSettings();
const now = moment();
const result = createPdfDefinition(timekeep, settings, now);
const table = (result.content as Content[])[1] as any;
expect(table.layout.paddingBottom).toBeDefined();
expect(table.layout.paddingLeft).toBeDefined();
expect(table.layout.paddingTop).toBeDefined();
expect(table.layout.paddingRight).toBeDefined();
expect(table.layout.paddingRight).toBeDefined();
expect(table.layout.paddingRight()).toBe(8);
});
it("renders links correctly inside the entry name", () => {
const entry: TimeEntry = {
id: "1",

View file

@ -342,10 +342,6 @@ function createTableEntryCells(
const marginLeft = depth * 5;
if (depth > 0) {
const _bg = "#999";
}
return [
{
text: createTableEntryName(entry.name),