Skip to content

Commit ccc66d4

Browse files
committed
test(linear): add fetchRecentComments + postIssueComment to orchestration-test linear-feedback mock
The orchestration test file fully mocks linear-feedback; the single-task fall-through path (P4.2/P4.5) now calls fetchRecentComments + postIssueComment, so add both to the mock (default: no comments, clean post). Fixes the 3 fall-through single-task tests.
1 parent 743e30e commit ccc66d4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

cdk/test/handlers/linear-webhook-processor-orchestration.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ const upsertStatusCommentMock = jest.fn();
5757
const reactToCommentMock = jest.fn();
5858
const replyToCommentMock = jest.fn();
5959
const upsertThreadedReplyMock = jest.fn();
60+
const fetchRecentCommentsMock = jest.fn();
61+
const postIssueCommentMock = jest.fn();
6062
jest.mock('../../src/handlers/shared/linear-feedback', () => ({
6163
reportIssueFailure: (...args: unknown[]) => reportIssueFailureMock(...args),
6264
swapIssueReaction: (...args: unknown[]) => swapIssueReactionMock(...args),
@@ -66,6 +68,8 @@ jest.mock('../../src/handlers/shared/linear-feedback', () => ({
6668
reactToComment: (...args: unknown[]) => reactToCommentMock(...args),
6769
replyToComment: (...args: unknown[]) => replyToCommentMock(...args),
6870
upsertThreadedReply: (...args: unknown[]) => upsertThreadedReplyMock(...args),
71+
fetchRecentComments: (...args: unknown[]) => fetchRecentCommentsMock(...args),
72+
postIssueComment: (...args: unknown[]) => postIssueCommentMock(...args),
6973
EMOJI_STARTED: 'eyes',
7074
EMOJI_SUCCESS: 'white_check_mark',
7175
EMOJI_FAILURE: 'x',
@@ -141,6 +145,11 @@ describe('linear-webhook-processor — #247 orchestration routing', () => {
141145
createTaskCoreMock.mockResolvedValue({ statusCode: 201, body: JSON.stringify({ data: { task_id: 'child-task' } }) });
142146
reportIssueFailureMock.mockReset();
143147
reportIssueFailureMock.mockResolvedValue(undefined);
148+
// ADR-016: single-task fall-through pre-hydrates comments + posts a start
149+
// comment. Default to no comments / clean post so orchestration tests are
150+
// unaffected.
151+
fetchRecentCommentsMock.mockReset().mockResolvedValue([]);
152+
postIssueCommentMock.mockReset().mockResolvedValue({ ok: true });
144153
resolveLinearOauthTokenMock.mockReset();
145154
discoverOrchestrationMock.mockReset();
146155
swapIssueReactionMock.mockReset().mockResolvedValue(true);

0 commit comments

Comments
 (0)