diff --git a/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs b/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs index 3242bbfcaa..489b7c278e 100644 --- a/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs +++ b/source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs @@ -1344,6 +1344,7 @@ public void UpdateProperties_MatchProperties_NewProperty_Success() RegionCode = 1, } ); + propertyService.Setup(x => x.PopulateNewFileProperty(It.IsAny())).Returns(x => x); var userRepository = this._helper.GetService>(); userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny())).Returns(EntityHelper.CreateUser(1, Guid.NewGuid(), "Test", regionCode: 1)); diff --git a/source/frontend/src/utils/mapPropertyUtils.test.tsx b/source/frontend/src/utils/mapPropertyUtils.test.tsx index f0ff513d25..fa67062d77 100644 --- a/source/frontend/src/utils/mapPropertyUtils.test.tsx +++ b/source/frontend/src/utils/mapPropertyUtils.test.tsx @@ -31,6 +31,7 @@ const expectedMapProperty = { landArea: 647.4646, latitude: 48.432802005, longitude: -123.310041775, + legalDescription: undefined, name: undefined, pid: '000002500', pin: undefined, @@ -39,6 +40,10 @@ const expectedMapProperty = { coordinates: [[[-123.31014591, 48.43274258]]], type: 'Polygon', }, + fileLocation: { + lat: 48.432802005, + lng: -123.310041775, + }, propertyId: undefined, region: 1, regionName: 'South Coast', @@ -90,7 +95,7 @@ describe('mapPropertyUtils', () => { [{ address: '' }, { label: NameSourceType.NONE, value: '' }], [{ address: '1234 fake st' }, { label: NameSourceType.ADDRESS, value: '1234 fake st' }], ])( - 'getPropertyName test with source %p expecting %p', + 'getPropertyName test with source %o expecting %o', (mapProperty: IMapProperty, expectedName: PropertyName) => { const actualName = getPropertyName(mapProperty); expect(actualName.label).toEqual(expectedName.label); @@ -98,24 +103,20 @@ describe('mapPropertyUtils', () => { }, ); - it('getPrettyLatLng, empty', () => { - const prettyLatLng = getPrettyLatLng(undefined); - expect(prettyLatLng).toEqual(''); - }); - - it('getPrettyLatLng, valued', () => { - const prettyLatLng = getPrettyLatLng({ coordinate: { x: 1, y: 2 } }); - expect(prettyLatLng).toEqual('1.000000, 2.000000'); - }); - - it('getLatLng, empty', () => { - const latLng = getLatLng(undefined); - expect(latLng).toEqual(null); + it.each([ + ['empty', undefined, ''], + ['valued', { coordinate: { x: 1, y: 2 } }, '1.000000, 2.000000'], + ])('getPrettyLatLng - %s', (_, value, expected) => { + const prettyLatLng = getPrettyLatLng(value); + expect(prettyLatLng).toEqual(expected); }); - it('getLatLng, valued', () => { - const latLng = getLatLng({ coordinate: { x: 1, y: 2 } }); - expect(latLng).toEqual({ lat: 2, lng: 1 }); + it.each([ + ['empty', undefined, null], + ['valued', { coordinate: { x: 1, y: 2 } }, { lat: 2, lng: 1 }], + ])('getLatLng - %s', (_, value, expected) => { + const latLng = getLatLng(value); + expect(latLng).toEqual(expected); }); it.each([ @@ -152,7 +153,7 @@ describe('mapPropertyUtils', () => { { ...getEmptyFileProperty(), property: { ...getEmptyProperty(), pid: 1 } }, ], ])( - 'getFilePropertyName test with ignore name flag %p expecting %p source %p', + 'getFilePropertyName test with ignore name flag %o expecting %s source %o', (skipName: boolean, expectedName: PropertyName, mapProperty?: ApiGen_Concepts_FileProperty) => { const fileName = getFilePropertyName(mapProperty, skipName); expect(fileName.label).toEqual(expectedName.label); @@ -183,6 +184,10 @@ describe('mapPropertyUtils', () => { propertyId: undefined, region: undefined, regionName: undefined, + fileLocation: { + lat: 48.76613749999999, + lng: -123.46163749999998, + }, }, ], ], @@ -207,11 +212,15 @@ describe('mapPropertyUtils', () => { propertyId: undefined, region: undefined, regionName: undefined, + fileLocation: { + lat: 48.76613749999999, + lng: -123.46163749999998, + }, }, ], ], ])( - 'featuresToIdentifiedMapProperty test with feature values %p and address %p and expected map properties %p', + 'featuresToIdentifiedMapProperty test with feature values %o and address %o and expected map properties %o', ( values: FeatureCollection | undefined, address?: string, @@ -242,7 +251,7 @@ describe('mapPropertyUtils', () => { { ...expectedMapProperty, address: 'address' }, ], ])( - 'featuresetToMapProperty test with feature set %p address %p expectedPropertyFile %p', + 'featuresetToMapProperty test with feature set %o address %o expectedPropertyFile %o', ( featureSet: LocationFeatureDataset, address: string = 'unknown',