Skip to content

Commit 00435fd

Browse files
committed
UT fix
1 parent 8caeabd commit 00435fd

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/core/changelog/__test__/processing-changelog.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,16 @@ describe('when generating a changelog', () => {
168168

169169
const changeLog = processChangelog(oldVersion, newVersion);
170170

171+
// TODO: The changelog should display the old label and the new label
172+
// TODO: Same deal with fields
173+
171174
expect(changeLog.customObjectModifications).toEqual([
172175
{
173176
typeName: oldObject.name,
174177
modifications: [
175178
{
176179
__typename: 'CustomObjectLabelChanged',
177-
name: 'NewLabel',
180+
name: newObject.name,
178181
},
179182
],
180183
},

src/core/changelog/process-changelog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ function getCustomObjectModifications(oldVersion: VersionManifest, newVersion: V
111111

112112
function getModifiedCustomObjectLabels(typesInBoth: TypeInBoth<CustomObjectMetadata>[]): NewOrModifiedMember[] {
113113
return typesInBoth
114-
.filter(({ oldType, newType }) => oldType.label.toLowerCase() !== newType.label.toLowerCase())
114+
.filter(({ oldType, newType }) => oldType.label?.toLowerCase() !== newType.label?.toLowerCase())
115115
.map(({ newType }) => ({
116116
typeName: newType.name,
117-
modifications: [{ __typename: 'CustomObjectLabelChanged', name: newType.label }],
117+
modifications: [{ __typename: 'CustomObjectLabelChanged', name: newType.name }],
118118
}));
119119
}
120120

src/core/reflection/sobject/reflect-custom-object-sources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function validate(parseResult: unknown): E.Either<Error, { CustomObject: unknown
5959
return pipe(parseResult, isObject, E.chain(hasTheCustomObjectKey));
6060
}
6161

62-
function toObjectMetadata(parserResult: { CustomObject: object }): ObjectMetadata {
62+
function toObjectMetadata(parserResult: { CustomObject: unknown }): CustomObjectMetadata {
6363
const customObject = typeof parserResult.CustomObject === 'object' ? parserResult.CustomObject : {};
6464

6565
const defaultValues = {
@@ -68,7 +68,7 @@ function toObjectMetadata(parserResult: { CustomObject: object }): ObjectMetadat
6868
description: null,
6969
fields: [] as CustomFieldMetadata[],
7070
};
71-
return { ...defaultValues, ...customObject } as ObjectMetadata;
71+
return { ...defaultValues, ...customObject } as CustomObjectMetadata;
7272
}
7373

7474
function addName(objectMetadata: CustomObjectMetadata, name: string): CustomObjectMetadata {

0 commit comments

Comments
 (0)