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' ) }) })