diff --git a/web/src/lib/components/repo/DiffStatPill.stories.svelte b/web/src/lib/components/repo/DiffStatPill.stories.svelte index 47e6db2c7..81376aab4 100644 --- a/web/src/lib/components/repo/DiffStatPill.stories.svelte +++ b/web/src/lib/components/repo/DiffStatPill.stories.svelte @@ -10,6 +10,16 @@ await expect(canvas.getByText("-4")).toBeVisible(); }; + const showsInsertionsOnly = async ({ canvas, canvasElement }: PlayContext) => { + await expect(canvas.getByText("+12")).toBeVisible(); + await expect(canvasElement.textContent).not.toContain("-0"); + }; + + const showsDeletionsOnly = async ({ canvas, canvasElement }: PlayContext) => { + await expect(canvas.getByText("-4")).toBeVisible(); + await expect(canvasElement.textContent).not.toContain("+0"); + }; + const rendersNothing = async ({ canvasElement }: PlayContext) => { await expect(canvasElement.textContent?.trim()).toBe(""); }; @@ -26,9 +36,17 @@ - + - + 0 || stat.deletions > 0} - - +{stat.insertions} - - - -{stat.deletions} - + {#if stat.insertions > 0} + + +{stat.insertions} + + {/if} + {#if stat.deletions > 0} + + -{stat.deletions} + + {/if} {/if}