Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/__tests__/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,29 @@ describe("fetchOpenPRs (real gh CLI)", () => {

describe("fetchRepoPRs (real gh CLI)", () => {
test("returns PRs for a known repo with branch info", async () => {
// OctavianTocan/to-do-app has many open PRs
const prs = await fetchRepoPRs("OctavianTocan/to-do-app")
// cli/cli has many open PRs
const prs = await fetchRepoPRs("cli/cli")
expect(Array.isArray(prs)).toBe(true)
expect(prs.length).toBeGreaterThan(0)

const pr = prs[0]
expect(pr.repo).toBe("OctavianTocan/to-do-app")
expect(pr.repo).toBe("cli/cli")
expect(pr.headRefName).toBeTruthy()
expect(pr.baseRefName).toBeTruthy()
expect(pr.number).toBeGreaterThan(0)
expect(pr.url).toContain("github.com/OctavianTocan/to-do-app/pull/")
expect(pr.url).toContain("github.com/cli/cli/pull/")
})

test("body is truncated to max 80 chars single line", async () => {
const prs = await fetchRepoPRs("OctavianTocan/to-do-app")
const prs = await fetchRepoPRs("cli/cli")
for (const pr of prs) {
expect(pr.body.length).toBeLessThanOrEqual(80)
expect(pr.body).not.toContain("\n")
}
})

test("all PRs have the correct repo field set", async () => {
const repo = "OctavianTocan/to-do-app"
const repo = "cli/cli"
const prs = await fetchRepoPRs(repo)
for (const pr of prs) {
expect(pr.repo).toBe(repo)
Expand Down Expand Up @@ -193,7 +193,7 @@ describe("formatStackedTitle", () => {

describe("end-to-end: fetch -> detect -> format", () => {
test("full pipeline works for a real repo", async () => {
const prs = await fetchRepoPRs("OctavianTocan/to-do-app")
const prs = await fetchRepoPRs("cli/cli")
expect(prs.length).toBeGreaterThan(0)

const stacks = detectStacks(prs)
Expand Down
Loading
Loading