From 642fbbe745b428fae673ef7417f2159d970b8d5d Mon Sep 17 00:00:00 2001 From: Joel Davies Date: Tue, 12 Dec 2023 10:56:11 +0000 Subject: [PATCH] Adjust copy and move messages to match catalogue ones #136 --- src/api/systems.test.tsx | 18 ++++++++---------- src/api/systems.tsx | 8 ++++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/api/systems.test.tsx b/src/api/systems.test.tsx index 57e55c467..4b45e97fa 100644 --- a/src/api/systems.test.tsx +++ b/src/api/systems.test.tsx @@ -267,7 +267,7 @@ describe('System api functions', () => { ); expect(result.current.data).toEqual( moveToSystem.selectedSystems.map((system) => ({ - message: `Successfully moved ${system.name} to Root`, + message: `Successfully moved to Root`, name: system.name, state: 'success', })) @@ -299,7 +299,7 @@ describe('System api functions', () => { ); expect(result.current.data).toEqual( moveToSystem.selectedSystems.map((system) => ({ - message: `Successfully moved ${system.name} to New system name`, + message: `Successfully moved to New system name`, name: system.name, state: 'success', })) @@ -343,8 +343,7 @@ describe('System api functions', () => { state: 'error', } : { - message: - 'Successfully moved Smaller laser to New system name', + message: 'Successfully moved to New system name', name: system.name, state: 'success', } @@ -399,7 +398,7 @@ describe('System api functions', () => { ); expect(result.current.data).toEqual( copyToSystem.selectedSystems.map((system) => ({ - message: `Successfully copied ${system.name} to Root`, + message: `Successfully copied to Root`, name: system.name, state: 'success', })) @@ -432,7 +431,7 @@ describe('System api functions', () => { ); expect(result.current.data).toEqual( copyToSystem.selectedSystems.map((system) => ({ - message: `Successfully copied ${system.name} to New system name`, + message: `Successfully copied to New system name`, name: system.name, state: 'success', })) @@ -472,8 +471,8 @@ describe('System api functions', () => { ); expect(result.current.data).toEqual( copyToSystem.selectedSystems.map((system, index) => ({ - message: `Successfully copied ${system.name} to Root`, - name: index === 0 ? 'System1_copy_1' : 'System2_copy_3', + message: `Successfully copied to Root`, + name: system.name, state: 'success', })) ); @@ -518,8 +517,7 @@ describe('System api functions', () => { state: 'error', } : { - message: - 'Successfully copied Smaller laser to New system name', + message: 'Successfully copied to New system name', name: system.name, state: 'success', } diff --git a/src/api/systems.tsx b/src/api/systems.tsx index 04318368b..50ed47391 100644 --- a/src/api/systems.tsx +++ b/src/api/systems.tsx @@ -255,8 +255,8 @@ export const useMoveToSystem = (): UseMutationResult< .then((result: System) => { const targetSystemName = moveToSystem.targetSystem?.name || 'Root'; transferStates.push({ - name: result.name, - message: `Successfully moved ${system.name} to ${targetSystemName}`, + name: system.name, + message: `Successfully moved to ${targetSystemName}`, state: 'success', }); @@ -331,8 +331,8 @@ export const useCopyToSystem = (): UseMutationResult< .then((result: System) => { const targetSystemName = copyToSystem.targetSystem?.name || 'Root'; transferStates.push({ - name: result.name, - message: `Successfully copied ${system.name} to ${targetSystemName}`, + name: system.name, + message: `Successfully copied to ${targetSystemName}`, state: 'success', });