@auto-engineer/narrative 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-format.log +1 -1
  3. package/.turbo/turbo-lint.log +1 -1
  4. package/.turbo/turbo-test.log +6 -6
  5. package/.turbo/turbo-type-check.log +5 -4
  6. package/CHANGELOG.md +13 -0
  7. package/dist/src/commands/export-schema-runner.js +6 -1
  8. package/dist/src/commands/export-schema-runner.js.map +1 -1
  9. package/dist/src/fluent-builder.specs.js +2 -2
  10. package/dist/src/fluent-builder.specs.js.map +1 -1
  11. package/dist/src/getNarratives.cache.specs.js +5 -5
  12. package/dist/src/getNarratives.cache.specs.js.map +1 -1
  13. package/dist/src/getNarratives.specs.js +194 -207
  14. package/dist/src/getNarratives.specs.js.map +1 -1
  15. package/dist/src/id/addAutoIds.specs.js +72 -409
  16. package/dist/src/id/addAutoIds.specs.js.map +1 -1
  17. package/dist/src/id/hasAllIds.specs.js +215 -408
  18. package/dist/src/id/hasAllIds.specs.js.map +1 -1
  19. package/dist/src/model-to-narrative.specs.js +505 -564
  20. package/dist/src/model-to-narrative.specs.js.map +1 -1
  21. package/dist/src/narrative-context.specs.js +58 -133
  22. package/dist/src/narrative-context.specs.js.map +1 -1
  23. package/dist/src/schema.d.ts +302 -302
  24. package/dist/src/transformers/narrative-to-model/type-inference.specs.js +94 -104
  25. package/dist/src/transformers/narrative-to-model/type-inference.specs.js.map +1 -1
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +4 -4
  28. package/dist/src/transformers/model-to-narrative/generators/gwt.specs.d.ts +0 -2
  29. package/dist/src/transformers/model-to-narrative/generators/gwt.specs.d.ts.map +0 -1
  30. package/dist/src/transformers/model-to-narrative/generators/gwt.specs.js +0 -142
  31. package/dist/src/transformers/model-to-narrative/generators/gwt.specs.js.map +0 -1
@@ -1,424 +1,231 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { addAutoIds, hasAllIds } from './index.js';
1
+ import { describe, expect, it, beforeEach } from 'vitest';
2
+ import { hasAllIds, addAutoIds } from './index.js';
3
+ import { getNarratives } from '../getNarratives.js';
4
+ import { InMemoryFileStore } from '@auto-engineer/file-store';
5
+ import * as flowApi from '../narrative.js';
6
+ import * as fluent from '../fluent-builder.js';
7
+ import * as dataBuilders from '../data-narrative-builders.js';
8
+ import * as typesApi from '../types.js';
9
+ import gql from 'graphql-tag';
10
+ const importMap = {
11
+ '../flow': flowApi,
12
+ '../fluent-builder': fluent,
13
+ '../data-flow-builders': dataBuilders,
14
+ '../types': typesApi,
15
+ 'graphql-tag': gql,
16
+ };
3
17
  describe('hasAllIds', () => {
4
- const createModelWithoutIds = () => ({
5
- variant: 'specs',
6
- narratives: [
7
- {
8
- name: 'Test Flow Without IDs',
9
- slices: [
10
- {
11
- type: 'command',
12
- name: 'Test slice without ID',
13
- client: { specs: [] },
14
- server: {
15
- description: 'Test server',
16
- specs: [
17
- {
18
- type: 'gherkin',
19
- feature: 'Test specs',
20
- rules: [
21
- {
22
- name: 'Test rule without ID',
23
- examples: [],
24
- },
25
- ],
26
- },
27
- ],
28
- },
29
- },
30
- ],
31
- },
32
- ],
33
- messages: [],
34
- integrations: [],
35
- });
36
- const createModelWithIds = () => ({
37
- variant: 'specs',
38
- narratives: [
39
- {
40
- name: 'Test Flow with IDs',
41
- id: 'FLOW-001',
42
- slices: [
43
- {
44
- type: 'command',
45
- name: 'Test slice with ID',
46
- id: 'SLICE-001',
47
- client: { specs: [] },
48
- server: {
49
- description: 'Test server',
50
- specs: [
51
- {
52
- id: 'SPEC-001',
53
- type: 'gherkin',
54
- feature: 'Test specs',
55
- rules: [
56
- {
57
- id: 'RULE-001',
58
- name: 'Test rule with ID',
59
- examples: [],
60
- },
61
- ],
62
- },
63
- ],
64
- },
65
- },
66
- ],
67
- },
68
- ],
69
- messages: [],
70
- integrations: [],
18
+ let vfs;
19
+ const root = '/test';
20
+ beforeEach(async () => {
21
+ vfs = new InMemoryFileStore();
22
+ const flowWithoutIds = `
23
+ import { flow, specs, rule, example } from '../narrative.js';
24
+ import { command } from '../fluent-builder.js';
25
+
26
+ flow('Test Flow Without IDs', () => {
27
+ command('Test slice without ID')
28
+ .server(() => {
29
+ specs('Test specs', () => {
30
+ rule('Test rule without ID', () => {
31
+ example('Test example')
32
+ .when({ test: 'data' })
33
+ .then({ result: 'success' });
34
+ });
35
+ });
36
+ });
37
+ });`;
38
+ const flowWithIds = `
39
+ import { flow, specs, rule, example } from '../narrative.js';
40
+ import { command } from '../fluent-builder.js';
41
+
42
+ flow('Test Flow with IDs', 'FLOW-001', () => {
43
+ command('Test slice with ID', 'SLICE-001')
44
+ .server(() => {
45
+ specs('Test specs', () => {
46
+ rule('Test rule with ID', 'RULE-001', () => {
47
+ example('Test example')
48
+ .when({ test: 'data' })
49
+ .then({ result: 'success' });
50
+ });
51
+ });
52
+ });
53
+ });`;
54
+ const multipleFlowsSameSource = `
55
+ import { flow, specs, should } from '../narrative.js';
56
+ import { experience } from '../fluent-builder.js';
57
+
58
+ flow('Home Screen', 'AUTO-aifPcU3hw', () => {
59
+ experience('Active Surveys Summary', 'AUTO-slice1').client(() => {
60
+ specs(() => {
61
+ should('show active surveys summary');
62
+ });
63
+ });
64
+ });
65
+
66
+ flow('Create Survey', 'AUTO-MPviTMrQC', () => {
67
+ experience('Create Survey Form', 'AUTO-slice2').client(() => {
68
+ specs(() => {
69
+ should('allow entering survey title');
71
70
  });
72
- const createModelWithFullIds = () => ({
73
- variant: 'specs',
74
- narratives: [
75
- {
76
- name: 'Test Flow with Full IDs',
77
- id: 'FLOW-001',
78
- slices: [
79
- {
80
- type: 'command',
81
- name: 'Test slice with ID',
82
- id: 'SLICE-001',
83
- client: { specs: [] },
84
- server: {
85
- description: 'Test server',
86
- specs: [
87
- {
88
- id: 'SPEC-001',
89
- type: 'gherkin',
90
- feature: 'Test specs',
91
- rules: [
92
- {
93
- id: 'RULE-001',
94
- name: 'Test rule with ID',
95
- examples: [
96
- {
97
- id: 'EXAMPLE-001',
98
- name: 'Test example',
99
- steps: [
100
- {
101
- id: 'STEP-001',
102
- keyword: 'Given',
103
- text: 'TestState',
104
- docString: { value: 'test' },
105
- },
106
- {
107
- id: 'STEP-002',
108
- keyword: 'When',
109
- text: 'TestCommand',
110
- },
111
- {
112
- id: 'STEP-003',
113
- keyword: 'Then',
114
- text: 'TestEvent',
115
- },
116
- ],
117
- },
118
- ],
119
- },
120
- ],
121
- },
122
- ],
123
- },
124
- },
125
- ],
126
- },
127
- ],
128
- messages: [],
129
- integrations: [],
71
+ });
72
+ });
73
+
74
+ flow('Response Analytics', 'AUTO-eME978Euk', () => {
75
+ experience('Response Rate Charts', 'AUTO-slice3').client(() => {
76
+ specs(() => {
77
+ should('show daily response rate charts');
78
+ });
79
+ });
80
+ });`;
81
+ const multipleFlowsIncomplete = `
82
+ import { flow, specs, should } from '../narrative.js';
83
+ import { experience } from '../fluent-builder.js';
84
+
85
+ flow('Home Screen', 'AUTO-aifPcU3hw', () => {
86
+ experience('Active Surveys Summary', 'AUTO-slice1').client(() => {
87
+ specs(() => {
88
+ should('show active surveys summary');
89
+ });
90
+ });
91
+ });
92
+
93
+ flow('Create Survey', () => {
94
+ experience('Create Survey Form', 'AUTO-slice2').client(() => {
95
+ specs(() => {
96
+ should('allow entering survey title');
130
97
  });
131
- const createMultipleFlowsModel = (includeAllIds, includeAllSliceIds) => ({
132
- variant: 'specs',
133
- narratives: [
134
- {
135
- name: 'Home Screen',
136
- id: 'aifPcU3hw',
137
- sourceFile: '/path/to/homepage.narrative.ts',
138
- slices: [
139
- {
140
- name: 'Active Surveys Summary',
141
- id: 'slice1',
142
- type: 'experience',
143
- client: { specs: [{ type: 'it', id: 'it1', title: 'show active surveys summary' }] },
144
- },
145
- ],
146
- },
147
- {
148
- name: 'Create Survey',
149
- id: includeAllIds ? 'MPviTMrQC' : undefined,
150
- sourceFile: '/path/to/homepage.narrative.ts',
151
- slices: [
152
- {
153
- name: 'Create Survey Form',
154
- id: includeAllSliceIds ? 'slice2' : undefined,
155
- type: 'experience',
156
- client: { specs: [{ type: 'it', id: 'it2', title: 'allow entering survey title' }] },
157
- },
158
- ],
159
- },
160
- {
161
- name: 'Response Analytics',
162
- id: 'eME978Euk',
163
- sourceFile: '/path/to/homepage.narrative.ts',
164
- slices: [
165
- {
166
- name: 'Response Rate Charts',
167
- id: 'slice3',
168
- type: 'experience',
169
- client: { specs: [{ type: 'it', id: 'it3', title: 'show daily response rate charts' }] },
170
- },
171
- ],
172
- },
173
- ],
174
- messages: [],
175
- integrations: [],
98
+ });
99
+ });
100
+
101
+ flow('Response Analytics', 'AUTO-eME978Euk', () => {
102
+ experience('Response Rate Charts', 'AUTO-slice3').client(() => {
103
+ specs(() => {
104
+ should('show daily response rate charts');
105
+ });
106
+ });
107
+ });`;
108
+ const multipleFlowsSliceMissing = `
109
+ import { flow, specs, should } from '../narrative.js';
110
+ import { experience } from '../fluent-builder.js';
111
+
112
+ flow('Home Screen', 'AUTO-aifPcU3hw', () => {
113
+ experience('Active Surveys Summary', 'AUTO-slice1').client(() => {
114
+ specs(() => {
115
+ should('show active surveys summary');
116
+ });
117
+ });
118
+ });
119
+
120
+ flow('Create Survey', 'AUTO-MPviTMrQC', () => {
121
+ experience('Create Survey Form').client(() => {
122
+ specs(() => {
123
+ should('allow entering survey title');
176
124
  });
177
- it('should return false for models without IDs', () => {
178
- const model = createModelWithoutIds();
179
- expect(hasAllIds(model)).toBe(false);
125
+ });
126
+ });
127
+
128
+ flow('Response Analytics', 'AUTO-eME978Euk', () => {
129
+ experience('Response Rate Charts', 'AUTO-slice3').client(() => {
130
+ specs(() => {
131
+ should('show daily response rate charts');
132
+ });
133
+ });
134
+ });`;
135
+ const flowContent1 = new TextEncoder().encode(flowWithoutIds);
136
+ const flowContent2 = new TextEncoder().encode(flowWithIds);
137
+ const flowContent3 = new TextEncoder().encode(multipleFlowsSameSource);
138
+ const flowContent4 = new TextEncoder().encode(multipleFlowsIncomplete);
139
+ const flowContent5 = new TextEncoder().encode(multipleFlowsSliceMissing);
140
+ await vfs.write('/test/flow-without-ids.narrative.ts', flowContent1);
141
+ await vfs.write('/test/flow-with-ids.narrative.ts', flowContent2);
142
+ await vfs.write('/test/homepage.narrative.ts', flowContent3);
143
+ await vfs.write('/test/homepage-incomplete.narrative.ts', flowContent4);
144
+ await vfs.write('/test/homepage-slice-missing.narrative.ts', flowContent5);
145
+ });
146
+ it('should return false for models without IDs', async () => {
147
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
148
+ const model = result.toModel();
149
+ const flowWithoutIds = model.narratives.find((f) => f.name === 'Test Flow Without IDs');
150
+ expect(flowWithoutIds).toBeDefined();
151
+ if (flowWithoutIds) {
152
+ const modelWithoutIds = { ...model, narratives: [flowWithoutIds] };
153
+ expect(hasAllIds(modelWithoutIds)).toBe(false);
154
+ }
180
155
  });
181
- it('should return true for models with complete IDs', () => {
182
- const model = createModelWithoutIds();
156
+ it('should return true for models with complete IDs', async () => {
157
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
158
+ const model = result.toModel();
183
159
  const modelWithIds = addAutoIds(model);
184
160
  expect(hasAllIds(modelWithIds)).toBe(true);
185
161
  });
186
- it('should return true for flows that already have IDs', () => {
187
- const model = createModelWithIds();
188
- expect(hasAllIds(model)).toBe(true);
189
- });
190
- it('should return false if any slice is missing an ID', () => {
191
- const model = createModelWithIds();
192
- const modifiedModel = structuredClone(model);
193
- modifiedModel.narratives[0].slices[0].id = '';
194
- expect(hasAllIds(modifiedModel)).toBe(false);
195
- });
196
- it('should return false if any rule is missing an ID', () => {
197
- const model = createModelWithIds();
198
- const modifiedModel = structuredClone(model);
199
- const slice = modifiedModel.narratives[0].slices[0];
200
- if ('server' in slice && slice.server?.specs !== undefined && Array.isArray(slice.server.specs)) {
201
- slice.server.specs[0].rules[0].id = '';
162
+ it('should return true for flows that already have IDs', async () => {
163
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
164
+ const model = result.toModel();
165
+ const testFlowWithIds = model.narratives.find((f) => f.name === 'Test Flow with IDs');
166
+ expect(testFlowWithIds).toBeDefined();
167
+ if (testFlowWithIds) {
168
+ const modelWithExistingIds = { ...model, narratives: [testFlowWithIds] };
169
+ expect(hasAllIds(modelWithExistingIds)).toBe(true);
202
170
  }
203
- expect(hasAllIds(modifiedModel)).toBe(false);
204
- });
205
- it('should return true when multiple flows with same sourceFile all have IDs', () => {
206
- const model = createMultipleFlowsModel(true, true);
207
- expect(hasAllIds(model)).toBe(true);
208
- });
209
- it('should return false when any flow in multiple flows with same sourceFile is missing ID', () => {
210
- const model = createMultipleFlowsModel(false, true);
211
- expect(hasAllIds(model)).toBe(false);
212
171
  });
213
- it('should return false when any slice in multiple flows with same sourceFile is missing ID', () => {
214
- const model = createMultipleFlowsModel(true, false);
215
- expect(hasAllIds(model)).toBe(false);
216
- });
217
- it('should return false if any spec is missing an ID', () => {
218
- const model = createModelWithFullIds();
219
- const modifiedModel = structuredClone(model);
220
- const slice = modifiedModel.narratives[0].slices[0];
221
- if ('server' in slice && slice.server?.specs !== undefined && Array.isArray(slice.server.specs)) {
222
- slice.server.specs[0].id = '';
223
- }
224
- expect(hasAllIds(modifiedModel)).toBe(false);
225
- });
226
- it('should return false if any example is missing an ID', () => {
227
- const model = createModelWithFullIds();
228
- const modifiedModel = structuredClone(model);
229
- const slice = modifiedModel.narratives[0].slices[0];
230
- if ('server' in slice && slice.server?.specs !== undefined && Array.isArray(slice.server.specs)) {
231
- slice.server.specs[0].rules[0].examples[0].id = '';
232
- }
172
+ it('should return false if any slice is missing an ID', async () => {
173
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
174
+ const model = result.toModel();
175
+ const modelWithIds = addAutoIds(model);
176
+ expect(modelWithIds.narratives.length).toBeGreaterThan(0);
177
+ expect(modelWithIds.narratives[0].slices.length).toBeGreaterThan(0);
178
+ const modifiedModel = structuredClone(modelWithIds);
179
+ modifiedModel.narratives[0].slices[0].id = '';
233
180
  expect(hasAllIds(modifiedModel)).toBe(false);
234
181
  });
235
- it('should return false if any step is missing an ID', () => {
236
- const model = createModelWithFullIds();
237
- const modifiedModel = structuredClone(model);
238
- const slice = modifiedModel.narratives[0].slices[0];
239
- if ('server' in slice && slice.server?.specs !== undefined && Array.isArray(slice.server.specs)) {
240
- slice.server.specs[0].rules[0].examples[0].steps[0].id = '';
182
+ it('should return false if any rule is missing an ID', async () => {
183
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
184
+ const model = result.toModel();
185
+ const modelWithIds = addAutoIds(model);
186
+ let found = false;
187
+ for (const flow of modelWithIds.narratives) {
188
+ for (const slice of flow.slices) {
189
+ if ('server' in slice && slice.server?.specs?.rules !== undefined && slice.server.specs.rules.length > 0) {
190
+ const modifiedModel = structuredClone(modelWithIds);
191
+ const modifiedFlow = modifiedModel.narratives.find((f) => f.name === flow.name);
192
+ const modifiedSlice = modifiedFlow?.slices.find((s) => s.name === slice.name);
193
+ if (modifiedSlice && 'server' in modifiedSlice && modifiedSlice.server?.specs?.rules !== undefined) {
194
+ modifiedSlice.server.specs.rules[0].id = '';
195
+ expect(hasAllIds(modifiedModel)).toBe(false);
196
+ found = true;
197
+ break;
198
+ }
199
+ }
200
+ }
201
+ if (found)
202
+ break;
241
203
  }
242
- expect(hasAllIds(modifiedModel)).toBe(false);
243
- });
244
- it('should return false if step with error is missing an ID', () => {
245
- const model = {
246
- variant: 'specs',
247
- narratives: [
248
- {
249
- name: 'Test Flow',
250
- id: 'FLOW-001',
251
- slices: [
252
- {
253
- type: 'command',
254
- name: 'Test slice',
255
- id: 'SLICE-001',
256
- client: { specs: [] },
257
- server: {
258
- description: 'Test server',
259
- specs: [
260
- {
261
- id: 'SPEC-001',
262
- type: 'gherkin',
263
- feature: 'Test specs',
264
- rules: [
265
- {
266
- id: 'RULE-001',
267
- name: 'Test rule',
268
- examples: [
269
- {
270
- id: 'EXAMPLE-001',
271
- name: 'Error example',
272
- steps: [
273
- {
274
- id: 'STEP-001',
275
- keyword: 'Given',
276
- text: 'TestState',
277
- },
278
- {
279
- keyword: 'Then',
280
- error: { type: 'ValidationError', message: 'Invalid input' },
281
- },
282
- ],
283
- },
284
- ],
285
- },
286
- ],
287
- },
288
- ],
289
- },
290
- },
291
- ],
292
- },
293
- ],
294
- messages: [],
295
- integrations: [],
296
- };
297
- expect(hasAllIds(model)).toBe(false);
298
- });
299
- it('should return false if client it spec is missing an ID', () => {
300
- const model = {
301
- variant: 'specs',
302
- narratives: [
303
- {
304
- name: 'Test Flow',
305
- id: 'FLOW-001',
306
- slices: [
307
- {
308
- name: 'Test slice',
309
- id: 'SLICE-001',
310
- type: 'experience',
311
- client: {
312
- specs: [{ type: 'it', title: 'test without id' }],
313
- },
314
- },
315
- ],
316
- },
317
- ],
318
- messages: [],
319
- integrations: [],
320
- };
321
- expect(hasAllIds(model)).toBe(false);
322
- });
323
- it('should return false if client describe spec is missing an ID', () => {
324
- const model = {
325
- variant: 'specs',
326
- narratives: [
327
- {
328
- name: 'Test Flow',
329
- id: 'FLOW-001',
330
- slices: [
331
- {
332
- name: 'Test slice',
333
- id: 'SLICE-001',
334
- type: 'experience',
335
- client: {
336
- specs: [
337
- {
338
- type: 'describe',
339
- title: 'test describe without id',
340
- children: [{ type: 'it', id: 'IT-001', title: 'nested it with id' }],
341
- },
342
- ],
343
- },
344
- },
345
- ],
346
- },
347
- ],
348
- messages: [],
349
- integrations: [],
350
- };
351
- expect(hasAllIds(model)).toBe(false);
352
- });
353
- it('should return false if nested client it spec is missing an ID', () => {
354
- const model = {
355
- variant: 'specs',
356
- narratives: [
357
- {
358
- name: 'Test Flow',
359
- id: 'FLOW-001',
360
- slices: [
361
- {
362
- name: 'Test slice',
363
- id: 'SLICE-001',
364
- type: 'experience',
365
- client: {
366
- specs: [
367
- {
368
- type: 'describe',
369
- id: 'DESC-001',
370
- title: 'test describe with id',
371
- children: [{ type: 'it', title: 'nested it without id' }],
372
- },
373
- ],
374
- },
375
- },
376
- ],
377
- },
378
- ],
379
- messages: [],
380
- integrations: [],
381
- };
382
- expect(hasAllIds(model)).toBe(false);
383
- });
384
- it('should return true for client specs with all IDs', () => {
385
- const model = {
386
- variant: 'specs',
387
- narratives: [
388
- {
389
- name: 'Test Flow',
390
- id: 'FLOW-001',
391
- slices: [
392
- {
393
- name: 'Test slice',
394
- id: 'SLICE-001',
395
- type: 'experience',
396
- client: {
397
- specs: [
398
- {
399
- type: 'describe',
400
- id: 'DESC-001',
401
- title: 'test describe',
402
- children: [
403
- { type: 'it', id: 'IT-001', title: 'first it' },
404
- {
405
- type: 'describe',
406
- id: 'DESC-002',
407
- title: 'nested describe',
408
- children: [{ type: 'it', id: 'IT-002', title: 'nested it' }],
409
- },
410
- ],
411
- },
412
- ],
413
- },
414
- },
415
- ],
416
- },
417
- ],
418
- messages: [],
419
- integrations: [],
420
- };
421
- expect(hasAllIds(model)).toBe(true);
204
+ expect(found).toBe(true);
205
+ });
206
+ it('should return true when multiple flows with same sourceFile all have IDs', async () => {
207
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
208
+ const model = result.toModel();
209
+ const homepageFlows = model.narratives.filter((f) => f.sourceFile !== undefined && f.sourceFile.includes('homepage.narrative.ts'));
210
+ expect(homepageFlows.length).toBe(3);
211
+ const homepageModel = { ...model, narratives: homepageFlows };
212
+ expect(hasAllIds(homepageModel)).toBe(true);
213
+ });
214
+ it('should return false when any flow in multiple flows with same sourceFile is missing ID', async () => {
215
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
216
+ const model = result.toModel();
217
+ const homepageFlows = model.narratives.filter((f) => f.sourceFile !== undefined && f.sourceFile.includes('homepage-incomplete.narrative.ts'));
218
+ expect(homepageFlows.length).toBe(3);
219
+ const homepageModel = { ...model, narratives: homepageFlows };
220
+ expect(hasAllIds(homepageModel)).toBe(false);
221
+ });
222
+ it('should return false when any slice in multiple flows with same sourceFile is missing ID', async () => {
223
+ const result = await getNarratives({ vfs, root, pattern: /\.(narrative)\.(ts)$/, fastFsScan: true, importMap });
224
+ const model = result.toModel();
225
+ const homepageFlows = model.narratives.filter((f) => f.sourceFile !== undefined && f.sourceFile.includes('homepage-slice-missing.narrative.ts'));
226
+ expect(homepageFlows.length).toBe(3);
227
+ const homepageModel = { ...model, narratives: homepageFlows };
228
+ expect(hasAllIds(homepageModel)).toBe(false);
422
229
  });
423
230
  });
424
231
  //# sourceMappingURL=hasAllIds.specs.js.map