mirror of
https://github.com/stablyai/orca.git
synced 2026-11-14 01:47:24 +00:00
test: remove 193 low-value tests (#39506)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -1,37 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
ghAccountBindingsEqual,
|
||||
ghTokenEnvVarForHost,
|
||||
normalizeGhAccountBinding
|
||||
} from './account-binding'
|
||||
|
||||
describe('normalizeGhAccountBinding', () => {
|
||||
it('trims, lowercases host, and preserves user case', () => {
|
||||
expect(normalizeGhAccountBinding({ host: ' GitHub.COM ', user: ' Alice ' })).toEqual({
|
||||
host: 'github.com',
|
||||
user: 'Alice'
|
||||
})
|
||||
})
|
||||
|
||||
it('rejects malformed shapes', () => {
|
||||
expect(normalizeGhAccountBinding(null)).toBeNull()
|
||||
expect(normalizeGhAccountBinding({ host: '', user: 'a' })).toBeNull()
|
||||
expect(normalizeGhAccountBinding({ host: 'github.com', user: '' })).toBeNull()
|
||||
expect(normalizeGhAccountBinding({ host: 'bad host', user: 'a' })).toBeNull()
|
||||
expect(normalizeGhAccountBinding({ host: 'github.com', user: 'has space' })).toBeNull()
|
||||
})
|
||||
|
||||
it('accepts GHES/LDAP logins with underscores and dots', () => {
|
||||
expect(normalizeGhAccountBinding({ host: 'github.acme.com', user: 'svc_build' })).toEqual({
|
||||
host: 'github.acme.com',
|
||||
user: 'svc_build'
|
||||
})
|
||||
expect(normalizeGhAccountBinding({ host: 'github.acme.com', user: 'first.last' })).toEqual({
|
||||
host: 'github.acme.com',
|
||||
user: 'first.last'
|
||||
})
|
||||
})
|
||||
})
|
||||
import { ghTokenEnvVarForHost } from './account-binding'
|
||||
|
||||
describe('ghTokenEnvVarForHost', () => {
|
||||
it('selects GH_TOKEN for github.com, github.localhost, and *.ghe.com', () => {
|
||||
@@ -45,20 +13,3 @@ describe('ghTokenEnvVarForHost', () => {
|
||||
expect(ghTokenEnvVarForHost('ghe.internal')).toBe('GH_ENTERPRISE_TOKEN')
|
||||
})
|
||||
})
|
||||
|
||||
describe('ghAccountBindingsEqual', () => {
|
||||
it('compares equal pairs and preserves user case sensitivity', () => {
|
||||
expect(
|
||||
ghAccountBindingsEqual(
|
||||
{ host: 'github.com', user: 'Alice' },
|
||||
{ host: 'github.com', user: 'Alice' }
|
||||
)
|
||||
).toBe(true)
|
||||
expect(
|
||||
ghAccountBindingsEqual(
|
||||
{ host: 'github.com', user: 'Alice' },
|
||||
{ host: 'github.com', user: 'alice' }
|
||||
)
|
||||
).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user