mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 16:02:50 +00:00
* fix: make PR unlink hide auto-detected reviews * Type the empty-content test double against the real model The literal narrowed suppressedGitHubPR to number and typed the callback as Mock, so neither direction was comparable and tsconfig.tc.web.json failed on TS2352. Keeping the 'as' cast preserves checking of the fields the double does supply. * Add localization keys for the unlinked checks-panel state The unlinked title, relink action, and the remote-runtime upgrade notice introduced untranslated keys that static analysis requires in en.json. * Advertise PR suppression capability in the transport test The client capability list is pinned by websocket-transport.test.ts, and adding WORKTREE_GITHUB_PR_SUPPRESSION left the expected list stale. * Fix stale PR suppression in Checks * fix: harden PR unlink suppression state * refactor: extract PR unlink state handling * fix: show PR relink recovery in source control * fix: add unlinked PR localization * Clarify workspace-scoped PR unlinking --------- Co-authored-by: Merge Sim <sim@local>
39 lines
1.7 KiB
TypeScript
39 lines
1.7 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
NATIVE_REMOTE_RUNTIME_CLIENT_CAPABILITIES,
|
|
RUNTIME_CAPABILITIES,
|
|
WORKTREE_GITHUB_PR_SUPPRESSION_RUNTIME_CAPABILITY
|
|
} from '../protocol-version'
|
|
import { remoteRuntimeClientCapabilities } from '../remote-runtime-client-capabilities'
|
|
import { isGitHubPRSuppressed, normalizeGitHubPRSuppressionUpdate } from './github-pr-suppression'
|
|
|
|
describe('GitHub PR suppression', () => {
|
|
it('suppresses only a matching discovered PR without an explicit link', () => {
|
|
expect(isGitHubPRSuppressed({ linkedPR: null, suppressedGitHubPR: 42 }, 42)).toBe(true)
|
|
expect(isGitHubPRSuppressed({ linkedPR: null, suppressedGitHubPR: 42 }, 43)).toBe(false)
|
|
})
|
|
|
|
it('lets an explicit GitHub PR link override stale suppression metadata', () => {
|
|
expect(isGitHubPRSuppressed({ linkedPR: 42, suppressedGitHubPR: 42 }, 42)).toBe(false)
|
|
})
|
|
|
|
it('clears suppression in the same update that explicitly links a PR', () => {
|
|
expect(normalizeGitHubPRSuppressionUpdate({ linkedPR: 42, suppressedGitHubPR: 7 })).toEqual({
|
|
linkedPR: 42,
|
|
suppressedGitHubPR: null
|
|
})
|
|
const clear = { linkedPR: null, suppressedGitHubPR: 42 }
|
|
expect(normalizeGitHubPRSuppressionUpdate(clear)).toBe(clear)
|
|
})
|
|
|
|
it('advertises suppression support from hosts and native remote clients', () => {
|
|
expect(RUNTIME_CAPABILITIES).toContain(WORKTREE_GITHUB_PR_SUPPRESSION_RUNTIME_CAPABILITY)
|
|
expect(NATIVE_REMOTE_RUNTIME_CLIENT_CAPABILITIES).toContain(
|
|
WORKTREE_GITHUB_PR_SUPPRESSION_RUNTIME_CAPABILITY
|
|
)
|
|
expect(remoteRuntimeClientCapabilities()).toContain(
|
|
WORKTREE_GITHUB_PR_SUPPRESSION_RUNTIME_CAPABILITY
|
|
)
|
|
})
|
|
})
|