From 8484dc60735c1e71a5ff7c4471e92f017d12a0f1 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 27 Jun 2024 15:18:25 +0200 Subject: [PATCH] update test --- .../Federation/CommunityVisualizeItem.spec.js | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/admin/src/components/Federation/CommunityVisualizeItem.spec.js b/admin/src/components/Federation/CommunityVisualizeItem.spec.js index 6ee1ba4f7..e2d10a3f9 100644 --- a/admin/src/components/Federation/CommunityVisualizeItem.spec.js +++ b/admin/src/components/Federation/CommunityVisualizeItem.spec.js @@ -284,8 +284,8 @@ describe('CommunityVisualizeItem', () => { describe('location', () => { beforeEach(async () => { wrapper = Wrapper() - wrapper.vm.originalLocation = { coordinates: [1.212, 15.121], type: 'Point' } - wrapper.vm.location = { coordinates: [17.212, 1.121], type: 'Point' } + wrapper.vm.originalLocation = { latitude: 15.121, longitude: 1.212 } + wrapper.vm.location = { latitude: 1.121, longitude: 17.212 } await wrapper.vm.handleUpdateHomeCommunity() // Wait for the next tick to allow async operations to complete @@ -295,12 +295,12 @@ describe('CommunityVisualizeItem', () => { it('expect changed location', () => { expect(updateHomeCommunityMock).toBeCalledWith({ uuid: propsData.item.uuid, - location: { coordinates: [17.212, 1.121], type: 'Point' }, + location: { latitude: 1.121, longitude: 17.212 }, gmsApiKey: undefined, }) expect(wrapper.vm.originalLocation).toStrictEqual({ - coordinates: [17.212, 1.121], - type: 'Point', + latitude: 1.121, + longitude: 17.212, }) expect(toastSuccessSpy).toBeCalledWith('federation.toast_gmsLocationUpdated') }) @@ -311,8 +311,8 @@ describe('CommunityVisualizeItem', () => { wrapper = Wrapper() wrapper.vm.originalGmsApiKey = 'original' wrapper.vm.gmsApiKey = 'changed key' - wrapper.vm.originalLocation = { coordinates: [1.212, 15.121], type: 'Point' } - wrapper.vm.location = { coordinates: [17.212, 1.121], type: 'Point' } + wrapper.vm.originalLocation = { latitude: 15.121, longitude: 1.212 } + wrapper.vm.location = { latitude: 1.121, longitude: 17.212 } await wrapper.vm.handleUpdateHomeCommunity() // Wait for the next tick to allow async operations to complete @@ -327,8 +327,8 @@ describe('CommunityVisualizeItem', () => { }) expect(wrapper.vm.originalGmsApiKey).toBe('changed key') expect(wrapper.vm.originalLocation).toStrictEqual({ - coordinates: [17.212, 1.121], - type: 'Point', + latitude: 1.121, + longitude: 17.212, }) expect(toastSuccessSpy).toBeCalledWith('federation.toast_gmsApiKeyAndLocationUpdated') }) @@ -343,14 +343,11 @@ describe('CommunityVisualizeItem', () => { it('test', () => { wrapper.vm.originalGmsApiKey = 'original' wrapper.vm.gmsApiKey = 'changed key' - wrapper.vm.originalLocation = { coordinates: [1.212, 15.121], type: 'Point' } - wrapper.vm.location = { coordinates: [17.212, 1.121], type: 'Point' } + wrapper.vm.originalLocation = { latitude: 15.121, longitude: 1.212 } + wrapper.vm.location = { latitude: 1.121, longitude: 17.212 } wrapper.vm.resetHomeCommunityEditable() - expect(wrapper.vm.location).toStrictEqual({ - coordinates: [1.212, 15.121], - type: 'Point', - }) + expect(wrapper.vm.location).toStrictEqual({ latitude: 15.121, longitude: 1.212 }) expect(wrapper.vm.gmsApiKey).toBe('original') }) })