Scrum4Me/__tests__/lib/job-status-url.test.ts
janpeter visser f59f4754df feat: GitHub-link op DONE-card + pushed_at doorvoer
- lib/job-status-url.ts: getBranchUrl(repoUrl, branch) → GitHub tree URL
- JobState + ClaudeJobEvent: pushed_at? veld toegevoegd
- realtime/solo/route.ts: pushed_at in Prisma-select, JobPayload en mapping
- SoloBoardProps + TaskDetailDialog: repoUrl prop doorgevoerd
- task-detail-dialog: "Open op GitHub"-link als done + pushed_at + branch + repoUrl
- 3 unit-tests voor getBranchUrl; totaal 261 tests groen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:04:47 +02:00

22 lines
744 B
TypeScript

import { describe, it, expect } from 'vitest'
import { getBranchUrl } from '@/lib/job-status-url'
describe('getBranchUrl', () => {
it('builds a GitHub tree URL from repo URL and branch', () => {
expect(getBranchUrl('https://github.com/owner/repo', 'feat/job-abc12345')).toBe(
'https://github.com/owner/repo/tree/feat/job-abc12345',
)
})
it('strips trailing .git suffix', () => {
expect(getBranchUrl('https://github.com/owner/repo.git', 'feat/job-abc')).toBe(
'https://github.com/owner/repo/tree/feat/job-abc',
)
})
it('strips trailing slash', () => {
expect(getBranchUrl('https://github.com/owner/repo/', 'feat/job-abc')).toBe(
'https://github.com/owner/repo/tree/feat/job-abc',
)
})
})