Skip to content

Commit d1eb39c

Browse files
committed
Lists all removed fields of a custom object
1 parent db5c1fb commit d1eb39c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,27 @@ describe('when generating a changelog', () => {
203203
]);
204204
});
205205

206-
// [] - Lists all removed fields of an object
206+
it('lists all removed fields of a custom object', () => {
207+
const oldField = new CustomFieldMetadataBuilder().build();
208+
const oldObject = new CustomObjectMetadataBuilder().withField(oldField).build();
209+
const newObject = new CustomObjectMetadataBuilder().build();
210+
const oldVersion = { types: [oldObject] };
211+
const newVersion = { types: [newObject] };
212+
213+
const changeLog = processChangelog(oldVersion, newVersion);
214+
215+
expect(changeLog.customObjectModifications).toEqual([
216+
{
217+
typeName: oldObject.name,
218+
modifications: [
219+
{
220+
__typename: 'RemovedField',
221+
name: oldField.name,
222+
},
223+
],
224+
},
225+
]);
226+
});
207227
// [] - Lists changed field labels
208228
});
209229

0 commit comments

Comments
 (0)