Skip to content

Commit cb9940f

Browse files
chore: test updates
1 parent 3377efe commit cb9940f

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

messages/assess.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@
197197
"dmNameUpdateFailed": "DM reference %s can’t be updated",
198198
"invalidTypeAssessErrorMessage": "We couldn't assess your Omnistudio components in the %s namespace. Select the correct namespace and try again",
199199
"assessmentSuccessfulMessage": "Migration assessment for org %s is complete and reports are ready for review in the folder %s",
200-
"needManualInterventionAsSpecialCharsInChildFlexcardName": "Child Flexcards with special characters in their names must be manually migrated.",
201-
"needManualInterventionAsSpecialCharsInFlexcardName": "This Flexcard contains special characters in its name. It must be manually migrated.",
202200
"errorCheckingOmniStudioMetadata": "We couldn't check whether the Omnistudio Metadata is enabled: %s. Try again later.",
203201
"omniStudioSettingsMetadataAlreadyEnabled": "The Omnistudio Metadata setting is already enabled with standard data model. No need for migration."
204202
}

messages/migrate.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@
247247
"generatedCustomLabelAssessmentReportPage": "Generated custom label assessment report page %s of %s with %s labels",
248248
"varDeclarationUpdated": "Variable initialization has been updated for target name",
249249
"migrationSuccessfulMessage": "Migration process for org %s is complete and reports are ready for review in the folder %s",
250-
"needManualInterventionAsSpecialCharsInChildFlexcardName": "Need manual intervention as child flexcards have special characters in their name",
251-
"needManualInterventionAsSpecialCharsInFlexcardName": "Need manual intervention as flexcard has special characters in name",
252250
"metadataTablesAlreadyClean": "OmniStudio metadata tables are empty",
253251
"startingMetadataCleanup": "Initiated cleanup process for Omnistudio metadata tables.",
254252
"failedToCleanTables": "Table cleanup failed: %s",

test/migration/flexcard-standard-datamodel.test.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ describe('FlexCard Standard Data Model (Metadata API Disabled) - Assessment and
3030
mockConnection = {};
3131
mockMessages = {
3232
getMessage: (key: string, args?: string[]) => {
33-
if (key === 'needManualInterventionAsSpecialCharsInFlexcardName') {
34-
return 'FlexCard name contains special characters and cannot be auto-migrated';
35-
}
3633
if (key === 'cardNameChangeMessage') {
3734
return `The card name '${args?.[0]}' will be changed to '${args?.[1]}'`;
3835
}
@@ -117,9 +114,10 @@ describe('FlexCard Standard Data Model (Metadata API Disabled) - Assessment and
117114
expect(result.name).to.equal('CustomerProfileCard');
118115
expect(result.oldName).to.equal('Customer-Profile@Card!');
119116

120-
// Should add warning for manual intervention due to special characters
121-
expect(result.warnings).to.include('FlexCard name contains special characters and cannot be auto-migrated');
122-
expect(result.migrationStatus).to.equal('Needs Manual Intervention');
117+
// Should add warning about name change (name updates are now allowed, so status is Warnings not Manual Intervention)
118+
expect(result.warnings).to.have.length.greaterThan(0);
119+
expect(result.warnings[0]).to.include("will be changed to 'CustomerProfileCard'");
120+
expect(result.migrationStatus).to.equal('Warnings');
123121

124122
// Dependencies should still be detected for assessment
125123
expect(result.dependenciesDR).to.have.length.greaterThan(0);
@@ -193,7 +191,7 @@ describe('FlexCard Standard Data Model (Metadata API Disabled) - Assessment and
193191
it('should map OmniUiCard fields correctly for Standard Data Model', () => {
194192
const mockCardRecord = {
195193
Id: 'fc1',
196-
Name: 'TestCard',
194+
Name: 'TestCard!@#',
197195
DataSourceConfig: JSON.stringify({
198196
type: 'DataRaptor',
199197
value: { bundle: 'TestBundle' },
@@ -218,7 +216,7 @@ describe('FlexCard Standard Data Model (Metadata API Disabled) - Assessment and
218216
expect(result.AuthorName).to.equal('TestAuthor');
219217
expect(result.VersionNumber).to.equal(2);
220218
expect(result.OmniUiCardType).to.equal('Parent');
221-
expect(result.OmniUiCardKey).to.equal('test-card-key');
219+
expect(result.OmniUiCardKey).to.equal('TestCard/TestAuthor/2.0');
222220
});
223221

224222
it('should process DataRaptor data source and preserve registry mapping functionality', () => {
@@ -612,7 +610,7 @@ describe('FlexCard Standard Data Model (Metadata API Disabled) - Assessment and
612610
expect(result.StylingConfiguration).to.equal('style-config');
613611
expect(result.OmniUiCardType).to.equal('Parent');
614612
expect(result.VersionNumber).to.equal(1);
615-
expect(result.OmniUiCardKey).to.equal('card-key');
613+
expect(result.OmniUiCardKey).to.equal('TestCard/TestAuthor/1.0');
616614
});
617615
});
618616
});

test/migration/flexcard/flexcard-angular-dependencies.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ describe('FlexCard Angular Dependency Validation', () => {
257257
}),
258258
};
259259

260-
// Mock getAllActiveCards method
261-
(cardTool as any).getAllActiveCards = () => Promise.resolve([mockFlexCardWithAngular, mockFlexCardWithLWC]);
260+
// Mock getAllCards method
261+
(cardTool as any).getAllCards = () => Promise.resolve([mockFlexCardWithAngular, mockFlexCardWithLWC]);
262262

263263
// Mock uploadAllCards method to track which cards are processed
264264
const processedCards: any[] = [];
@@ -293,7 +293,7 @@ describe('FlexCard Angular Dependency Validation', () => {
293293
}),
294294
};
295295

296-
(cardTool as any).getAllActiveCards = () => Promise.resolve([mockFlexCardWithAngular]);
296+
(cardTool as any).getAllCards = () => Promise.resolve([mockFlexCardWithAngular]);
297297
(cardTool as any).uploadAllCards = () => Promise.resolve(new Map());
298298

299299
const result = await cardTool.migrate();

0 commit comments

Comments
 (0)