From fe650cfc1e3152491e37d929abf0599588b285f6 Mon Sep 17 00:00:00 2001 From: Craig Martin Date: Wed, 1 Apr 2026 16:50:08 +0000 Subject: [PATCH] test: add regression tests for clientSteps passthrough in specification factories Ensures clientSteps is properly forwarded in createContractBasedModuleSpecification, createExtensionSpecification, and createConfigExtensionSpecification. Prevents regression of the bug fixed in #7141 where clientSteps was accidentally dropped from createContractBasedModuleSpecification during a conflict resolution, breaking channel_config extension builds. --- .../specification.integration.test.ts | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/packages/app/src/cli/models/extensions/specification.integration.test.ts b/packages/app/src/cli/models/extensions/specification.integration.test.ts index 9bbcdd6167c..11f7912698d 100644 --- a/packages/app/src/cli/models/extensions/specification.integration.test.ts +++ b/packages/app/src/cli/models/extensions/specification.integration.test.ts @@ -1,5 +1,12 @@ import {loadLocalExtensionsSpecifications} from './load-specifications.js' -import {configWithoutFirstClassFields, createContractBasedModuleSpecification} from './specification.js' +import { + configWithoutFirstClassFields, + createContractBasedModuleSpecification, + createConfigExtensionSpecification, + createExtensionSpecification, +} from './specification.js' +import {BaseSchema} from './schemas.js' +import {ClientSteps} from '../../services/build/client-steps.js' import {AppSchema} from '../app/app.js' import {describe, test, expect, beforeAll} from 'vitest' @@ -28,6 +35,19 @@ describe('allLocalSpecs', () => { }) }) +const testClientSteps: ClientSteps = [ + { + lifecycle: 'deploy', + steps: [ + { + id: 'copy_static', + name: 'Copy static assets', + type: 'copy_static_assets', + }, + ], + }, +] + describe('createContractBasedModuleSpecification', () => { test('creates a specification with the given identifier', () => { // When @@ -48,6 +68,62 @@ describe('createContractBasedModuleSpecification', () => { ) expect(got.appModuleFeatures()).toEqual(['localization']) }) + + test('passes clientSteps through to the created specification', () => { + // When + const got = createContractBasedModuleSpecification({ + identifier: 'channel_config', + uidStrategy: 'uuid', + experience: 'extension', + appModuleFeatures: () => [], + clientSteps: testClientSteps, + }) + + // Then + expect(got.clientSteps).toEqual(testClientSteps) + }) + + test('clientSteps is undefined when not provided', () => { + // When + const got = createContractBasedModuleSpecification({ + identifier: 'test', + uidStrategy: 'uuid', + experience: 'extension', + appModuleFeatures: () => [], + }) + + // Then + expect(got.clientSteps).toBeUndefined() + }) +}) + +describe('createExtensionSpecification', () => { + test('passes clientSteps through to the created specification', () => { + // When + const got = createExtensionSpecification({ + identifier: 'test_extension', + appModuleFeatures: () => [], + clientSteps: testClientSteps, + }) + + // Then + expect(got.clientSteps).toEqual(testClientSteps) + }) +}) + +describe('createConfigExtensionSpecification', () => { + test('passes clientSteps through to the created specification', () => { + // When + const got = createConfigExtensionSpecification({ + identifier: 'test_config', + schema: BaseSchema, + transformConfig: {}, + clientSteps: testClientSteps, + }) + + // Then + expect(got.clientSteps).toEqual(testClientSteps) + }) }) describe('configWithoutFirstClassFields', () => {