From ab250275f460645183c5e488ee6b311f1220d63c Mon Sep 17 00:00:00 2001 From: mshanemc Date: Wed, 4 Dec 2024 14:11:58 -0600 Subject: [PATCH] test: update UT --- test/unit/remote/fileOperations.test.ts | 2 ++ test/unit/remote/remoteSourceTracking.test.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/unit/remote/fileOperations.test.ts b/test/unit/remote/fileOperations.test.ts index 8bf1713f..45df1b17 100644 --- a/test/unit/remote/fileOperations.test.ts +++ b/test/unit/remote/fileOperations.test.ts @@ -26,6 +26,7 @@ describe('writing file version based on env', () => { RevisionCounter: 1, MemberName: 'MyClass', IsNewMember: false, + LastModifiedDate: new Date().toJSON(), } satisfies MemberRevision, ], ]); @@ -97,6 +98,7 @@ describe('upgrading undefined file version to v1 file', () => { IsNameObsolete: false, RevisionCounter: 1, MemberName: 'MyClass', + LastModifiedDate: 'unknown', } satisfies Omit); }); diff --git a/test/unit/remote/remoteSourceTracking.test.ts b/test/unit/remote/remoteSourceTracking.test.ts index 8f9ce8dd..fe9a7a85 100644 --- a/test/unit/remote/remoteSourceTracking.test.ts +++ b/test/unit/remote/remoteSourceTracking.test.ts @@ -23,7 +23,7 @@ import { RemoteSyncInput, RemoteChangeElement } from '../../../src/shared/types' import * as orgQueryMocks from '../../../src/shared/remote/orgQueries'; import { getMetadataNameFromKey, getMetadataTypeFromKey } from '../../../src/shared/functions'; -import { ContentsV0, MemberRevision, SourceMember } from '../../../src/shared/remote/types'; +import { ContentsV0, ContentsV1, MemberRevision, SourceMember } from '../../../src/shared/remote/types'; config.truncateThreshold = 0; @@ -34,6 +34,7 @@ const defaultSourceMemberValues = { RevisionCounter: 1, ChangedBy: 'Shelby McLaughlin', MemberIdOrName: '00eO4000003cP5JIAU', + LastModifiedDate: new Date().toJSON(), } satisfies Partial; const getSourceMember = (revision: number, isDeleted = false): SourceMember => ({ @@ -126,6 +127,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }; const changeResult = remoteChangeElementToChangeResult(rce); expect(changeResult).to.deep.equal({ @@ -137,6 +139,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }); }); @@ -149,6 +152,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }; const changeResult = remoteChangeElementToChangeResult(rce); expect(changeResult).to.deep.equal({ @@ -160,6 +164,7 @@ describe('remoteSourceTrackingService', () => { changedBy: 'Shelby McLaughlin', revisionCounter: 1, memberIdOrName, + lastModifiedDate: defaultSourceMemberValues.LastModifiedDate, }); }); }); @@ -564,6 +569,7 @@ describe('remoteSourceTrackingService', () => { }); const contents = { serverMaxRevisionCounter: 1, + fileVersion: 1, sourceMembers: { 'Profile###my(awesome)profile': { ...defaultSourceMemberValues, @@ -575,7 +581,7 @@ describe('remoteSourceTrackingService', () => { MemberType: 'Profile', }, }, - }; + } satisfies ContentsV1; setContents(contents); await remoteSourceTrackingService.syncSpecifiedElements([ {