Skip to content

Commit

Permalink
Update methodology testName when copying test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrf1 committed Jan 14, 2025
1 parent 6a7e6b5 commit ef8e23b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/src/components/channelManagement/testsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
updateStatuses,
} from '../../utils/requests';
import { useParams } from 'react-router-dom';
import { addMethodologyToTestName } from './helpers/methodology';

const useStyles = makeStyles(({ spacing, typography }: Theme) => ({
viewTextContainer: {
Expand Down Expand Up @@ -221,6 +222,10 @@ export const TestsForm = <T extends Test>(
},
isNew: true,
campaignName,
methodologies: oldTest.methodologies.map(methodology => ({
...methodology,
testName: addMethodologyToTestName(newName, methodology),
})),
};
setTests([...tests, newTest]);
setSelectedTestName(newName);
Expand Down

0 comments on commit ef8e23b

Please sign in to comment.