Files
orca/src/shared/github/pr-comment-mutability.test.ts
T
Kelvin Amoaba 88ffc5c5d1 fix(mobile): use desktop's check rules and fix-checks prompt in the PR panel (#34014)
* fix(mobile): prepare Create PR and the commit action like desktop

Create PR now fast-forwards a behind-only branch before committing, picks its push step
from desktop's shared rule, and the commit-area button reads the branch's review state.

* fix(mobile): keep Create PR commit failures intact and skip fork push-target gating

Restaging after a failed commit is best effort and checks the branch first, and reviews
with their own push target are not gated until mobile reads targeted upstream status.

* fix(mobile): enter Create PR on desktop's intent rule and leave fork push targets ungated

* refactor(mobile): share the linked-review push decision and enter Create PR on desktop's intent rule

Desktop and mobile compose the review push target through one shared function, the
Create button admits branches Create PR can prepare, and older hosts without a lookup
outcome still fail closed on mobile.

* fix(mobile): use desktop's check order, labels and fix-checks prompt in the PR panel

Check, step, reviewer and comment rules move to src/shared; the phone's fix-checks agent
now gets failing log tails, the worktree path and the action's saved agent arguments.

* test(shared): pass only the fields comment mutability reads

* refactor(mobile): gate fix-checks on desktop's broken-check set and drop the prompt re-export

Fix and Rerun show for the same checks the prompt and the host use, desktop imports
the fix-checks prompt from src/shared directly, and job steps split through the shared summary.
2026-10-27 03:20:02 +00:00

28 lines
824 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isMutablePRConversationComment } from './pr-comment-mutability'
describe('isMutablePRConversationComment', () => {
it('allows top-level conversation comments but not review threads or summaries', () => {
expect(
isMutablePRConversationComment({
id: 12,
url: 'https://github.com/acme/widgets/pull/42#issuecomment-12'
})
).toBe(true)
expect(
isMutablePRConversationComment({
id: 34,
url: 'https://github.com/acme/widgets/pull/42#discussion_r34',
threadId: 'thread-1',
path: 'src/a.ts'
})
).toBe(false)
expect(
isMutablePRConversationComment({
id: 99,
url: 'https://github.com/acme/widgets/pull/42#pullrequestreview-99'
})
).toBe(false)
})
})