Skip to content

Commit 9b4bdc6

Browse files
committed
test(lint): pin the date-text arithmetic refusal on a sweep-only flow
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CaUg3ibF939L2RFB5D
1 parent 52faf73 commit 9b4bdc6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎packages/lint/src/validate-expressions.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,15 @@ describe('validateStackExpressions (ADR-0032 build-time)', () => {
12221222
expect(date.map(i => i.severity)).toEqual(['error']);
12231223
expect(date[0]!.message).toMatch(/^date arithmetic/);
12241224
expect(date[0]!.message).toContain(': this faults at runtime, and a flow condition');
1225+
// Two date fields, which the runtime holds as their text: the
1226+
// `date-text-arithmetic` verdict, run-fails worded, refused too.
1227+
const dateText = validateStackExpressions({
1228+
objects: [{ name: 'crm_opportunity', fields: { close_date: { type: 'date' }, open_date: { type: 'date' } } }],
1229+
flows: [sweepOnly('close_date - open_date > duration("1h")')],
1230+
});
1231+
expect(dateText.map(i => i.severity)).toEqual(['error']);
1232+
expect(dateText[0]!.message).toMatch(/^date arithmetic `DateText - DateText`/);
1233+
expect(dateText[0]!.message).toContain(': this faults at runtime, and a flow condition');
12251234
});
12261235

12271236
// [#30026] Typed against the swept object, a well-typed sweep-only flow

0 commit comments

Comments
 (0)