mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 19:07:41 +00:00
test: remove low-value renderer main shared and script suites (#42548)
Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { classifyGitHubUnavailable } from './api-availability'
|
||||
|
||||
describe('classifyGitHubUnavailable', () => {
|
||||
it('classifies rate limiting as rate_limited (even when it carries HTTP 403)', () => {
|
||||
expect(classifyGitHubUnavailable('HTTP 403: API rate limit exceeded')).toBe('rate_limited')
|
||||
expect(classifyGitHubUnavailable('You have exceeded a secondary rate limit')).toBe(
|
||||
'rate_limited'
|
||||
)
|
||||
expect(classifyGitHubUnavailable('HTTP 429 Too Many Requests')).toBe('rate_limited')
|
||||
})
|
||||
|
||||
it('returns null for non-reachability failures', () => {
|
||||
expect(classifyGitHubUnavailable('HTTP 403: Resource not accessible by integration')).toBeNull()
|
||||
expect(classifyGitHubUnavailable('HTTP 404: Not Found')).toBeNull()
|
||||
expect(classifyGitHubUnavailable('could not resolve to a Repository with the name')).toBeNull()
|
||||
expect(
|
||||
classifyGitHubUnavailable(
|
||||
"GraphQL: Could not resolve to a Repository with the name 'network'."
|
||||
)
|
||||
).toBeNull()
|
||||
expect(classifyGitHubUnavailable('gh auth login required')).toBeNull()
|
||||
expect(classifyGitHubUnavailable('')).toBeNull()
|
||||
})
|
||||
|
||||
it('does not misread unrelated 3-digit numbers as a server outage', () => {
|
||||
expect(classifyGitHubUnavailable('found 512 pull requests')).toBeNull()
|
||||
})
|
||||
})
|
||||
@@ -1,28 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import type { PRInfo } from '../pull-request-types'
|
||||
import { normalizeGitHubPRForBranchOutcome } from './pull-request-for-branch-outcome'
|
||||
|
||||
const PR: PRInfo = {
|
||||
number: 42,
|
||||
title: 'Feature',
|
||||
state: 'merged',
|
||||
url: 'https://github.com/acme/orca/pull/42',
|
||||
checksStatus: 'success',
|
||||
updatedAt: '2026-08-04T22:46:08Z',
|
||||
mergeable: 'UNKNOWN'
|
||||
}
|
||||
|
||||
describe('normalizeGitHubPRForBranchOutcome', () => {
|
||||
it('normalizes legacy PRInfo and null responses', () => {
|
||||
expect(normalizeGitHubPRForBranchOutcome(PR, 20)).toEqual({
|
||||
kind: 'found',
|
||||
pr: PR,
|
||||
fetchedAt: 20
|
||||
})
|
||||
expect(normalizeGitHubPRForBranchOutcome(null, 20)).toEqual({
|
||||
kind: 'no-pr',
|
||||
fetchedAt: 20
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user