Skip to content

Commit

Permalink
Adjust copy and move messages to match catalogue ones #136
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvdavies committed Dec 12, 2023
1 parent 1bd8f1d commit 642fbbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
18 changes: 8 additions & 10 deletions src/api/systems.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}))
Expand Down Expand Up @@ -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',
}))
Expand Down Expand Up @@ -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',
}
Expand Down Expand Up @@ -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',
}))
Expand Down Expand Up @@ -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',
}))
Expand Down Expand Up @@ -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',
}))
);
Expand Down Expand Up @@ -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',
}
Expand Down
8 changes: 4 additions & 4 deletions src/api/systems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});

Expand Down Expand Up @@ -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',
});

Expand Down

0 comments on commit 642fbbe

Please sign in to comment.