| 1 | import { describe, expect, it } from "bun:test"; |
| 2 | |
| 3 | import type { IssueTimelineItem |
| 4 | import { commitRunAt } |
| 5 | |
| 6 | const event = ( |
| 7 | ({ |
| 8 | kind: "event", |
| 9 | id, |
| 10 | event: { id, |
| 11 | }) as unknown |
| 12 | const comment = ( |
| 13 | ({ kind: "comment" |
| 14 | |
| 15 | const ids = ( |
| 16 | run?.map((commit |
| 17 | |
| 18 | describe("commitRunAt", () |
| 19 | const items = |
| 20 | event("opened", |
| 21 | event("a", |
| 22 | event("b", |
| 23 | event("c", |
| 24 | comment("said"), |
| 25 | event("d", |
| 26 | ]; |
| 27 | |
| 28 | it("gathers one person's commits in a row into the block that starts them", |
| 29 | expect(ids(commitRunAt |
| 30 | expect(ids(commitRunAt |
| 31 | expect(ids(commitRunAt |
| 32 | }); |
| 33 | |
| 34 | it("leaves nothing to render for a commit that continues the block before it", |
| 35 | expect(commitRunAt(items |
| 36 | }); |
| 37 | }); |