59
expect(output).not.toContain('Temporary trigger disabled');
60
})
61
);
62
+
63
+ it.scoped('[Then] a bare --stream flag prints the whole event payload inline', () =>
64
+ Effect.gen(function* () {
65
+ yield* enableListen;
66
+ yield* cli([
67
+ 'listen',
68
+ 'composio.connected_account.expired',
69
+ '--max-events',
70
+ '1',
71
+ '--stream',
72
+ ]);
73
+
74
+ const lines = yield* MockConsole.getLines({ stripAnsi: true });
75
+ const output = lines.join('\n');
76
+
77
+ expect(output).not.toContain('Received unknown argument');
78
+ expect(output).toContain('stream: ');
79
+ expect(output).toContain('"data":{"id":"con_expired_1"}');
80
+ })
81
+ );
82
+
83
+ it.scoped('[Then] a bare --stream flag followed by another option is not swallowed', () =>
84
+ Effect.gen(function* () {
85
+ yield* enableListen;
86
+ yield* cli([
87
+ 'listen',
88
+ 'composio.connected_account.expired',
89
+ '--stream',
90
+ '--max-events',
91
+ '1',
92
+ ]);
93
+
94
+ const lines = yield* MockConsole.getLines({ stripAnsi: true });
95
+ const output = lines.join('\n');
96
+
97
+ expect(output).toContain('stream: ');
98
+ expect(output).toContain('Stopped after receiving 1 event.');
99
+ })
100
+ );
101
});
102
103
layer(
168
TestLive({
169
baseConfigProvider: testConfigProvider,
170
fixture: 'global-test-user-id',
171
+ toolkitsData: {
172
+ triggerTypes: [
173
+ {
174
+ slug: 'GMAIL_NEW_GMAIL_MESSAGE',
175
+ name: 'New Gmail Message',
176
+ description: 'Fires when a new email arrives.',
177
+ instructions: '',
178
+ type: 'poll',
179
+ config: {},
180
+ payload: {},
181
+ toolkit: { name: 'Gmail', slug: 'gmail' },
182
+ },
183
+ ],
184
+ },
185
})
186
)('listen validation and domain failures', it => {
187
it.scoped('reports malformed trigger params as CLI input validation', () =>
236
}
237
})
238
);
239
+
240
+ it.scoped('reports an unknown trigger slug instead of a missing connection', () =>
241
+ Effect.gen(function* () {
242
+ yield* enableListen;
243
+ const exit = yield* Effect.exit(cli(['listen', 'BOGUS_SLUG_XYZ']));
244
+
245
+ expect(Exit.isFailure(exit)).toBe(true);
246
+ if (Exit.isFailure(exit)) {
247
+ const failure = Cause.squash(exit.cause);
248
+ expect(failure).toBeInstanceOf(ListenCommandError);
249
+ if (failure instanceof ListenCommandError) {
250
+ expect(failure).toMatchObject({
251
+ reason: 'unknown_trigger',
252
+ slug: 'BOGUS_SLUG_XYZ',
253
+ toolkitSlug: 'bogus',
254
+ });
255
+ expect(failure.message).toContain('Unknown trigger slug "BOGUS_SLUG_XYZ"');
256
+ expect(failure.message).toContain('composio triggers list <toolkit>');
257
+ expect(failure.message).not.toContain('composio link');
258
+ }
259
+ }
260
+ })
261
+ );
262
});
263
});