Skip to content

Commit 487a197

Browse files
test(lint,service-automation): replace out-of-grammar record-created fixture token with record-after-create (#6636)
12 test fixtures spelled a flow start node's `triggerType` as `record-created`, which is outside the closed grammar the record-change trigger maps: /^record-(before|after)-(create|insert|update|delete|write)$/ (triggerTypeToHookEvents, packages/triggers/trigger-record-change) The token is missing its phase segment, so it maps to ZERO hook events — the exact shape `flow-trigger-unknown-event` reports, and an `error` since #5762. Nothing is red today: all three test files call their own rule directly (`validateFlowTemplatePaths` / `validateReferenceIntegrity` / the runtime expand integration) and none routes through `validateFlowTriggerReadiness`, which is not a `REFERENCE_INTEGRITY_RULES` member. This is a corpus fix, not a defect fix: fixtures are read as examples, and a token the platform's own lint calls "never fires" appearing 12 times in-repo teaches the wrong spelling to anyone (and any AI) reading the tests. `triggerType` is inert at all 12 sites — every fixture flow declares `type: 'record_change'`, so `isRecordTriggered` returns from its first branch without reading the token, and no assertion in any of the three files names `triggerType`. No assertion changes. Refs #5762, #3427. Fixes #5957 Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9f22801 commit 487a197

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

packages/lint/src/reference-integrity-suite.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe('reference-integrity suite — every member actually runs', () => {
191191
// the two must not diverge across commands again.
192192
runAs: 'user',
193193
nodes: [
194-
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } },
194+
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } },
195195
// validateFlowTemplatePaths: `budget` is not a field on crm_lead. In a
196196
// FILTER position an erased condition widens the query rather than
197197
// narrowing it, so the runtime refuses the node — gating, not advisory

packages/lint/src/validate-flow-template-paths.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function flowWith(notify: AnyRec, objectName = 'crm_lead'): AnyRec {
3232
name: 'notify_lead',
3333
type: 'record_change',
3434
nodes: [
35-
{ id: 'start', type: 'start', config: { objectName, triggerType: 'record-created' } },
35+
{ id: 'start', type: 'start', config: { objectName, triggerType: 'record-after-create' } },
3636
{ id: 'n1', type: 'notify', notify },
3737
],
3838
},
@@ -117,7 +117,7 @@ describe('validateFlowTemplatePaths', () => {
117117
name: 'external',
118118
type: 'record_change',
119119
nodes: [
120-
{ id: 'start', type: 'start', config: { objectName: 'sys_user', triggerType: 'record-created' } },
120+
{ id: 'start', type: 'start', config: { objectName: 'sys_user', triggerType: 'record-after-create' } },
121121
{ id: 'n1', type: 'notify', notify: { title: '{record.anything.deep}', body: 'x' } },
122122
],
123123
},
@@ -158,7 +158,7 @@ describe('validateFlowTemplatePaths', () => {
158158
name: 'typed_start',
159159
type: 'record_change',
160160
nodes: [
161-
{ id: 'start', type: 'start', start: { objectName: 'crm_lead', triggerType: 'record-created' } },
161+
{ id: 'start', type: 'start', start: { objectName: 'crm_lead', triggerType: 'record-after-create' } },
162162
{ id: 'n1', type: 'notify', notify: { title: '{record.crm_account.name}', body: 'x' } },
163163
],
164164
},
@@ -176,7 +176,7 @@ describe('validateFlowTemplatePaths', () => {
176176
name: 'webhook',
177177
type: 'record_change',
178178
nodes: [
179-
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } },
179+
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } },
180180
{ id: 'h1', type: 'http', http: { url: 'https://x.test/{record.full_naem}', method: 'GET' } },
181181
],
182182
},
@@ -197,7 +197,7 @@ describe('validateFlowTemplatePaths', () => {
197197
{
198198
id: 'start',
199199
type: 'start',
200-
config: { objectName: 'crm_lead', triggerType: 'record-created', expand: ['crm_account'] },
200+
config: { objectName: 'crm_lead', triggerType: 'record-after-create', expand: ['crm_account'] },
201201
},
202202
{ id: 'n1', type: 'notify', notify: { title: 'From {record.crm_account.name}', body: 'x' } },
203203
],
@@ -218,7 +218,7 @@ describe('validateFlowTemplatePaths', () => {
218218
{
219219
id: 'start',
220220
type: 'start',
221-
config: { objectName: 'crm_lead', triggerType: 'record-created', expand: ['target_channels'] },
221+
config: { objectName: 'crm_lead', triggerType: 'record-after-create', expand: ['target_channels'] },
222222
},
223223
{ id: 'n1', type: 'notify', notify: { title: 'From {record.crm_account.name}', body: 'x' } },
224224
],
@@ -247,7 +247,7 @@ describe('validateFlowTemplatePaths', () => {
247247
name: 'crud_flow',
248248
type: 'record_change',
249249
nodes: [
250-
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } },
250+
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } },
251251
{ id: 'c1', type, config },
252252
],
253253
},
@@ -330,7 +330,7 @@ describe('validateFlowTemplatePaths', () => {
330330
{
331331
id: 'start',
332332
type: 'start',
333-
config: { objectName: 'crm_lead', triggerType: 'record-created', expand: ['crm_account'] },
333+
config: { objectName: 'crm_lead', triggerType: 'record-after-create', expand: ['crm_account'] },
334334
},
335335
{
336336
id: 'c1',
@@ -360,7 +360,7 @@ describe('validateFlowTemplatePaths', () => {
360360
name: 'guarded',
361361
type: 'record_change',
362362
nodes: [
363-
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } },
363+
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } },
364364
{ id: 'guard', type: 'try_catch', label: 'Guard', config: container },
365365
],
366366
},
@@ -399,7 +399,7 @@ describe('validateFlowTemplatePaths', () => {
399399
name: 'looped',
400400
type: 'record_change',
401401
nodes: [
402-
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-created' } },
402+
{ id: 'start', type: 'start', config: { objectName: 'crm_lead', triggerType: 'record-after-create' } },
403403
{
404404
id: 'each',
405405
type: 'loop',

packages/services/service-automation/src/record-lookup-expand.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function expandFlow(name: string, runAs: 'system' | 'user', expand: string[], fi
5050
name, label: name, type: 'record_change', runAs,
5151
variables: [{ name: 'noteId', type: 'text', isInput: true }],
5252
nodes: [
53-
{ id: 'start', type: 'start', label: 'Start', config: { objectName: 'lead', triggerType: 'record-created', expand } },
53+
{ id: 'start', type: 'start', label: 'Start', config: { objectName: 'lead', triggerType: 'record-after-create', expand } },
5454
{ id: 'up', type: 'update_record', label: 'Up', config: { objectName: 'audit', filter: { id: '{noteId}' }, fields } },
5555
{ id: 'end', type: 'end', label: 'End' },
5656
],

0 commit comments

Comments
 (0)