mirror of
https://github.com/stablyai/orca.git
synced 2026-11-14 01:47:24 +00:00
18 lines
761 B
TypeScript
18 lines
761 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { githubProjectIdentityKey } from './project-identity'
|
|
|
|
describe('GitHub project identity', () => {
|
|
it('keeps legacy github.com keys while isolating Enterprise hosts and ports', () => {
|
|
const project = { owner: 'Acme', ownerType: 'organization' as const, number: 7 }
|
|
|
|
expect(githubProjectIdentityKey(project)).toBe('organization:acme:7')
|
|
expect(githubProjectIdentityKey({ ...project, host: 'github.com' })).toBe('organization:acme:7')
|
|
expect(githubProjectIdentityKey({ ...project, host: ' GitHub.com ' })).toBe(
|
|
'organization:acme:7'
|
|
)
|
|
expect(githubProjectIdentityKey({ ...project, host: 'GHE.EXAMPLE:8443' })).toBe(
|
|
'ghe.example:8443:organization:acme:7'
|
|
)
|
|
})
|
|
})
|