From 41758e10ef335a6f1cd7c091c4ac814b26fae336 Mon Sep 17 00:00:00 2001 From: prv-proton Date: Thu, 9 Jan 2025 13:00:57 -0800 Subject: [PATCH 1/6] Feat: LCFS - Update CR schedule text #1593 --- frontend/src/App.jsx | 10 +-- .../locales/en/allocationAgreement.json | 7 ++- .../locales/en/finalSupplyEquipment.json | 15 +++-- .../src/assets/locales/en/fuelExport.json | 4 +- .../src/assets/locales/en/fuelSupply.json | 4 +- .../assets/locales/en/notionalTransfer.json | 3 +- frontend/src/assets/locales/en/otherUses.json | 3 +- .../AddEditAllocationAgreements.jsx | 63 ++++++++++++------- .../AddEditFinalSupplyEquipments.jsx | 33 +++++----- .../views/FuelExports/AddEditFuelExports.jsx | 4 +- .../FuelSupplies/AddEditFuelSupplies.jsx | 4 +- .../AddEditNotionalTransfers.jsx | 47 +++++++++----- .../src/views/OtherUses/AddEditOtherUses.jsx | 8 +++ 13 files changed, 129 insertions(+), 76 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index b47a16e62..a9dd64219 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -333,7 +333,7 @@ const router = createBrowserRouter([ path: ROUTES.REPORTS_ADD_NOTIONAL_TRANSFERS, element: , handle: { - title: 'New Notional Transfer', + title: 'Notional transfer of eligible renewable fuels', mode: 'add' } }, @@ -341,7 +341,7 @@ const router = createBrowserRouter([ path: ROUTES.REPORTS_ADD_ALLOCATION_AGREEMENTS, element: , handle: { - title: 'New Allocation Agreement', + title: 'Allocation agreements', mode: 'add' } }, @@ -349,7 +349,7 @@ const router = createBrowserRouter([ path: ROUTES.REPORTS_ADD_OTHER_USE_FUELS, element: , handle: { - title: 'New Fuel for Other Use', + title: 'Fuels for other use', mode: 'add' } }, @@ -357,7 +357,7 @@ const router = createBrowserRouter([ path: ROUTES.REPORTS_ADD_FINAL_SUPPLY_EQUIPMENTS, element: , handle: { - title: 'Final Supply Equipment', + title: 'Final supply equipment', mode: 'add' } }, @@ -365,7 +365,7 @@ const router = createBrowserRouter([ path: ROUTES.REPORTS_ADD_SUPPLY_OF_FUEL, element: , handle: { - title: 'Supply of fuels', + title: 'Supply of fuel', mode: 'add' } }, diff --git a/frontend/src/assets/locales/en/allocationAgreement.json b/frontend/src/assets/locales/en/allocationAgreement.json index 554b3fbe6..b56ef8f49 100644 --- a/frontend/src/assets/locales/en/allocationAgreement.json +++ b/frontend/src/assets/locales/en/allocationAgreement.json @@ -1,8 +1,11 @@ { - "allocationAgreementTitle": "Allocation Agreement", + "allocationAgreementTitle": "Allocation agreements", "noAllocationAgreementsFound": "No allocation agreements found", "addAllocationAgreementRowsTitle": "Allocation agreements (e.g., allocating responsibility for fuel)", - "allocationAgreementSubtitle": "Enter allocation agreement details below", + "allocationAgreementGuides": [ + "Report fuel volumes for which you have an allocation agreement. Report both fuels that you have allocated responsibility to another organization, and fuels you have received responsibly from another organization.", + "Fuels that you have received responsibility for must also be reported in fuel supply." + ], "fuelCodeFieldRequiredError": "Error updating row: Fuel code field required", "allocationAgreementColLabels": { "allocationTransactionType": "Responsibility", diff --git a/frontend/src/assets/locales/en/finalSupplyEquipment.json b/frontend/src/assets/locales/en/finalSupplyEquipment.json index d8ed2de94..6473557f1 100644 --- a/frontend/src/assets/locales/en/finalSupplyEquipment.json +++ b/frontend/src/assets/locales/en/finalSupplyEquipment.json @@ -1,8 +1,11 @@ { "fseTitle": "Final supply equipment (FSE)", - "addFSErowsTitle": "Add new final supply equipment(s) (FSE)", - "fseSubtitle": "Report dates of supply for your FSE. If your billing location is different from your equipment location provided below use the Notes field. Use the Notes field if you use any Other options.", - "reportingResponsibilityInfo": "If you are reporting on behalf of an FSE for which you hold allocated reporting responsibility, please list the utility account holder's organization name associated with the specific station, rather than your own organization's name.", + "addFSErowsTitle": "Final supply equipment", + "reportingResponsibilityInfo": [ + "Report dates of supply for your final supply equipment (FSE).", + "Organization: Enter your organization name unless you are reporting FSE that you have received allocated responsibility. In this case, enter the utility account holder's organization name.", + "Enter the billing address in the Notes field if it is different than the equipment address. Also, enter an explanation in the Notes field if you select 'Other' from any of the select options." + ], "newFinalSupplyEquipmentBtn": "New final supply equipment", "noFinalSupplyEquipmentsFound": "No final supply equipments found", "finalSupplyEquipmentDownloadBtn": "Download as Excel", @@ -30,15 +33,15 @@ "complianceReportId": "Compliance Report ID", "organizationName": "Organization", "supplyFrom": "Supply date range", - "kwhUsage":"kWh usage", + "kwhUsage": "kWh usage", "supplyFromDate": "Dates of supply from", "supplyToDate": "Dates of supply to", "registrationNbr": "Registration #", "serialNbr": "Serial #", "manufacturer": "Manufacturer", - "model":"Model", + "model": "Model", "levelOfEquipment": "Level of equipment", - "ports":"Ports", + "ports": "Ports", "fuelMeasurementType": "Fuel measurement type", "intendedUses": "Intended use", "intendedUsers": "Intended users", diff --git a/frontend/src/assets/locales/en/fuelExport.json b/frontend/src/assets/locales/en/fuelExport.json index cc2cac887..1ffef51fd 100644 --- a/frontend/src/assets/locales/en/fuelExport.json +++ b/frontend/src/assets/locales/en/fuelExport.json @@ -1,8 +1,8 @@ { "fuelExportTitle": "Export fuel", "noFuelExportsFound": "No fuel exports found", - "addFuelExportRowsTitle": "Add new fuel export", - "fuelExportSubtitle": "You must report fuel that was marketed or supplied in B.C. and then exported out of the province. Only negative compliance units (debits) can be issued, credits cannot be issued for exported fuel.", + "addFuelExportRowsTitle": "Export fuels", + "fuelExportGuide": "Report fuel volumes that were marketed or supplied in B.C. and then exported out of the province. Only negative compliance units (debits) can be issued, credits cannot be issued for exported fuel.", "fuelExportDownloadBtn": "Download as Excel", "fuelExportDownloadingMsg": "Downloading export fuels information", "fuelExportDownloadFailMsg": "Failed to download export fuel information.", diff --git a/frontend/src/assets/locales/en/fuelSupply.json b/frontend/src/assets/locales/en/fuelSupply.json index 15ba14b59..ba42c9042 100644 --- a/frontend/src/assets/locales/en/fuelSupply.json +++ b/frontend/src/assets/locales/en/fuelSupply.json @@ -1,8 +1,8 @@ { - "fuelSupplyTitle": "Supply of fuels", + "fuelSupplyTitle": "Supply of fuel", "noFuelSuppliesFound": "No fuel supplies found", "addFuelSupplyRowsTitle": "Add new supply of fuel", - "fuelSupplySubtitle": "Report the fuel volumes supplied for various uses.", + "fuelSupplyGuide": "Report fuel volumes you supplied for the various end uses.", "fuelSupplyDownloadBtn": "Download as Excel", "fuelSupplyDownloadingMsg": "Downloading supply of fuels information", "fuelSupplyDownloadFailMsg": "Failed to download supply of fuel information.", diff --git a/frontend/src/assets/locales/en/notionalTransfer.json b/frontend/src/assets/locales/en/notionalTransfer.json index 804e61df2..865c4c7c2 100644 --- a/frontend/src/assets/locales/en/notionalTransfer.json +++ b/frontend/src/assets/locales/en/notionalTransfer.json @@ -7,7 +7,8 @@ "notionalTransferDownloadFailMsg": "Failed to download notional transfer information.", "LoadFailMsg": "Failed to load notional transfer rows.", "notionalTransferLoadFailMsg": "Failed to load notional transfer information.", - "newNotionalTransferTitle": "Add new notional transfer(s)", + "newNotionalTransferTitle": "Notional transfer of eligible renewable fuels", + "newNotionalTransferGuide": "Report renewable fuel volumes that you received or transferred through a notional transfer.", "editNotionalTransferTitle": "Edit draft notional transfer", "approvedNotionalTransferTitle": "Approved draft notional transfer", "deletedNotionalTransferTitle": "Deleted draft notional transfer", diff --git a/frontend/src/assets/locales/en/otherUses.json b/frontend/src/assets/locales/en/otherUses.json index 70b32650d..cd4ed2250 100644 --- a/frontend/src/assets/locales/en/otherUses.json +++ b/frontend/src/assets/locales/en/otherUses.json @@ -6,7 +6,8 @@ "otherUsesDownloadingMsg": "Downloading other uses information", "otherUsesDownloadFailMsg": "Failed to download other uses information.", "otherUsesLoadFailMsg": "Failed to load other uses information.", - "newOtherUsesTitle": "Add new other use(s)", + "newOtherUsesTitle": "Fuels for other use", + "newOtherUsesGuide": "Report fuel volumes that you supplied for heating or other prescribed uses other than transportation.", "editOtherUsesTitle": "Edit other use entry", "approvedOtherUsesTitle": "Approved other use entry", "deletedOtherUsesTitle": "Deleted other use entry", diff --git a/frontend/src/views/AllocationAgreements/AddEditAllocationAgreements.jsx b/frontend/src/views/AllocationAgreements/AddEditAllocationAgreements.jsx index 779d430e5..9c9cdd7b9 100644 --- a/frontend/src/views/AllocationAgreements/AddEditAllocationAgreements.jsx +++ b/frontend/src/views/AllocationAgreements/AddEditAllocationAgreements.jsx @@ -29,6 +29,9 @@ export const AddEditAllocationAgreements = () => { const alertRef = useRef() const location = useLocation() const { t } = useTranslation(['common', 'allocationAgreement', 'reports']) + const guides = useMemo(() => + t('allocationAgreement:allocationAgreementGuides', { returnObjects: true }) + ) const params = useParams() const { complianceReportId, compliancePeriod } = params const navigate = useNavigate() @@ -69,22 +72,28 @@ export const AddEditAllocationAgreements = () => { } }, [location.state?.message, location.state?.severity]) - const validate = (params, validationFn, errorMessage, alertRef, field = null) => { - const value = field ? params.node?.data[field] : params; + const validate = ( + params, + validationFn, + errorMessage, + alertRef, + field = null + ) => { + const value = field ? params.node?.data[field] : params if (field && params.colDef.field !== field) { - return true; + return true } if (!validationFn(value)) { alertRef.current?.triggerAlert({ message: errorMessage, - severity: 'error', - }); - return false; + severity: 'error' + }) + return false } - return true; // Proceed with the update - }; + return true // Proceed with the update + } const onGridReady = useCallback( async (params) => { @@ -119,7 +128,11 @@ export const AddEditAllocationAgreements = () => { ) useEffect(() => { - const updatedColumnDefs = allocationAgreementColDefs(optionsData, errors, currentUser) + const updatedColumnDefs = allocationAgreementColDefs( + optionsData, + errors, + currentUser + ) setColumnDefs(updatedColumnDefs) }, [errors, optionsData, currentUser]) @@ -179,7 +192,8 @@ export const AddEditAllocationAgreements = () => { if (params.colDef.field === 'transactionPartner') { if (params.newValue === currentUser.organization.name) { alertRef.current?.triggerAlert({ - message: 'You cannot select your own organization as the transaction partner.', + message: + 'You cannot select your own organization as the transaction partner.', severity: 'error' }) params.node.setDataValue('transactionPartner', '') @@ -190,12 +204,12 @@ export const AddEditAllocationAgreements = () => { const isValid = validate( params, (value) => { - return value !== null && !isNaN(value) && value > 0; + return value !== null && !isNaN(value) && value > 0 }, 'Quantity supplied must be greater than 0.', alertRef, - 'quantity', - ); + 'quantity' + ) if (!isValid) { return @@ -332,16 +346,21 @@ export const AddEditAllocationAgreements = () => {
- {t('allocationAgreement:addAllocationAgreementRowsTitle')} - - - {t('allocationAgreement:allocationAgreementSubtitle')} + {t('allocationAgreement:allocationAgreementTitle')} + + {guides.map((v, i) => ( + + {v} + + ))} +
{ const alertRef = useRef() const location = useLocation() const { t } = useTranslation(['common', 'finalSupplyEquipment', 'reports']) + const subTitles = t('finalSupplyEquipment:reportingResponsibilityInfo', { + returnObjects: true + }) const params = useParams() const { complianceReportId, compliancePeriod } = params const navigate = useNavigate() @@ -277,24 +280,20 @@ export const AddEditFinalSupplyEquipments = () => {
- {t('finalSupplyEquipment:addFSErowsTitle')} - - - {t('finalSupplyEquipment:fseSubtitle')} - - - {t('finalSupplyEquipment:reportingResponsibilityInfo')} + {t('finalSupplyEquipment:fseTitle')} + + {subTitles.map((v, i) => ( + + ))} +
{ - {t('fuelExport:fuelExportSubtitle')} + {t('fuelExport:fuelExportGuide')} diff --git a/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx b/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx index f76063182..935acb711 100644 --- a/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx +++ b/frontend/src/views/FuelSupplies/AddEditFuelSupplies.jsx @@ -360,12 +360,12 @@ export const AddEditFuelSupplies = () => {
- {t('fuelSupply:addFuelSupplyRowsTitle')} + {t('fuelSupply:fuelSupplyTitle')} {t('fuelSupply:fuelSupplySubtitle')} diff --git a/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx b/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx index 00a633f7d..fb17e5318 100644 --- a/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx +++ b/frontend/src/views/NotionalTransfers/AddEditNotionalTransfers.jsx @@ -44,24 +44,30 @@ export const AddEditNotionalTransfers = () => { severity: location.state.severity || 'info' }) } - }, [location?.state?.message, location?.state?.severity]); + }, [location?.state?.message, location?.state?.severity]) - const validate = (params, validationFn, errorMessage, alertRef, field = null) => { - const value = field ? params.node?.data[field] : params; + const validate = ( + params, + validationFn, + errorMessage, + alertRef, + field = null + ) => { + const value = field ? params.node?.data[field] : params if (field && params.colDef.field !== field) { - return true; + return true } if (!validationFn(value)) { alertRef.current?.triggerAlert({ message: errorMessage, - severity: 'error', - }); - return false; + severity: 'error' + }) + return false } - return true; // Proceed with the update - }; + return true // Proceed with the update + } const onGridReady = (params) => { const ensureRowIds = (rows) => { @@ -118,7 +124,8 @@ export const AddEditNotionalTransfers = () => { if (params.colDef.field === 'legalName') { if (params.newValue === currentUser.organization.name) { alertRef.current?.triggerAlert({ - message: 'You cannot select your own organization as the transaction partner.', + message: + 'You cannot select your own organization as the transaction partner.', severity: 'error' }) params.node.setDataValue('legalName', '') @@ -129,12 +136,12 @@ export const AddEditNotionalTransfers = () => { const isValid = validate( params, (value) => { - return value !== null && !isNaN(value) && value > 0; + return value !== null && !isNaN(value) && value > 0 }, 'Quantity supplied must be greater than 0.', alertRef, - 'quantity', - ); + 'quantity' + ) if (!isValid) { return @@ -234,7 +241,11 @@ export const AddEditNotionalTransfers = () => { useEffect(() => { if (!optionsLoading) { - const updatedColumnDefs = notionalTransferColDefs(optionsData, errors, currentUser) + const updatedColumnDefs = notionalTransferColDefs( + optionsData, + errors, + currentUser + ) setColumnDefs(updatedColumnDefs) } }, [errors, optionsData, optionsLoading, currentUser]) @@ -260,6 +271,14 @@ export const AddEditNotionalTransfers = () => { {t('notionalTransfer:newNotionalTransferTitle')} + + {t('notionalTransfer:newNotionalTransferGuide')} +
{ {t('otherUses:newOtherUsesTitle')} + + {t('otherUses:newOtherUsesGuide')} + Date: Thu, 9 Jan 2025 13:05:02 -0800 Subject: [PATCH 2/6] LCFS - BUG - Fuel supply label for End use #1625 --- frontend/src/assets/locales/en/fuelSupply.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/assets/locales/en/fuelSupply.json b/frontend/src/assets/locales/en/fuelSupply.json index ba42c9042..494954a24 100644 --- a/frontend/src/assets/locales/en/fuelSupply.json +++ b/frontend/src/assets/locales/en/fuelSupply.json @@ -16,7 +16,7 @@ "fuelType": "Fuel type", "fuelTypeOther": "Fuel type other", "fuelCategoryId": "Fuel category", - "endUseId": "End use", + "endUse": "End use", "provisionOfTheActId": "Determining carbon intensity", "fuelCode": "Fuel code", "quantity": "Quantity supplied", From 8d607c250f39d87ba6631d105cd67e656e987004 Mon Sep 17 00:00:00 2001 From: prv-proton Date: Thu, 9 Jan 2025 13:17:10 -0800 Subject: [PATCH 3/6] test cases fix --- .../__tests__/AddEditAllocationAgreements.test.jsx | 11 ++++++++--- .../__tests__/AddEditFuelSupplies.test.jsx | 13 +++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx index 76c78d006..c1443398f 100644 --- a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx +++ b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx @@ -35,9 +35,14 @@ vi.mock('react-router-dom', () => ({ // Mock react-i18next vi.mock('react-i18next', () => ({ useTranslation: () => ({ - t: (key) => key - }) -})) + t: vi.fn((key, { returnObjects }) => { + if (key === 'allocationAgreement:allocationAgreementGuides' && returnObjects) { + return ['Guide 1', 'Guide 2', 'Guide 3']; // Mocked guide objects + } + return key; + }), + }), +})); // Mock hooks related to allocation agreements vi.mock('@/hooks/useAllocationAgreement') diff --git a/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx b/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx index c31a71d49..15445e3df 100644 --- a/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx +++ b/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx @@ -25,9 +25,14 @@ vi.mock('react-router-dom', () => ({ // Mock react-i18next vi.mock('react-i18next', () => ({ useTranslation: () => ({ - t: (key) => key - }) -})) + t: vi.fn((key, { returnObjects }) => { + if (key === 'fuelSupplies:allocationAgreementGuides' && returnObjects) { + return ['Guide 1', 'Guide 2', 'Guide 3']; // Mocked guide objects + } + return key; + }), + }), +})); // Mock all hooks related to fuel supply vi.mock('@/hooks/useFuelSupply') @@ -92,7 +97,7 @@ describe('AddEditFuelSupplies', () => { render(, { wrapper }) // Check for a title or any text that indicates successful rendering expect( - screen.getByText('fuelSupply:addFuelSupplyRowsTitle') + screen.getByText('fuelSupply:fuelSupplyTitle') ).toBeInTheDocument() }) From 1b9de64eadf709303985149dd97f7a5132f98cfc Mon Sep 17 00:00:00 2001 From: prv-proton Date: Thu, 9 Jan 2025 13:26:55 -0800 Subject: [PATCH 4/6] . --- .../AddEditAllocationAgreements.test.jsx | 28 ++++++++++++++----- .../__tests__/AddEditFuelSupplies.test.jsx | 11 ++------ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx index c1443398f..e41d63c24 100644 --- a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx +++ b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx @@ -32,17 +32,31 @@ vi.mock('react-router-dom', () => ({ useParams: () => mockUseParams() })) +// Mock react-i18next // Mock react-i18next vi.mock('react-i18next', () => ({ useTranslation: () => ({ - t: vi.fn((key, { returnObjects }) => { - if (key === 'allocationAgreement:allocationAgreementGuides' && returnObjects) { - return ['Guide 1', 'Guide 2', 'Guide 3']; // Mocked guide objects + t: vi.fn((key, options = {}) => { + // Handle specific keys with returnObjects + if ( + key === 'allocationAgreement:allocationAgreementGuides' && + options.returnObjects + ) { + return ['Guide 1', 'Guide 2', 'Guide 3'] // Mocked guide objects + } + + // Handle other keys with or without options + switch (key) { + case 'allocationAgreement:addAllocationAgreementRowsTitle': + return 'Add Allocation Agreement Rows' + case 'allocationAgreement:noAllocationAgreementsFound': + return 'No Allocation Agreements Found' + default: + return key // Fallback to returning the key } - return key; - }), - }), -})); + }) + }) +})) // Mock hooks related to allocation agreements vi.mock('@/hooks/useAllocationAgreement') diff --git a/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx b/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx index 15445e3df..4417f3521 100644 --- a/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx +++ b/frontend/src/views/FuelSupplies/__tests__/AddEditFuelSupplies.test.jsx @@ -25,14 +25,9 @@ vi.mock('react-router-dom', () => ({ // Mock react-i18next vi.mock('react-i18next', () => ({ useTranslation: () => ({ - t: vi.fn((key, { returnObjects }) => { - if (key === 'fuelSupplies:allocationAgreementGuides' && returnObjects) { - return ['Guide 1', 'Guide 2', 'Guide 3']; // Mocked guide objects - } - return key; - }), - }), -})); + t: (key) => key + }) +})) // Mock all hooks related to fuel supply vi.mock('@/hooks/useFuelSupply') From 50b567b6564a1b0fddc49e88ab41674fb54cd97d Mon Sep 17 00:00:00 2001 From: prv-proton Date: Thu, 9 Jan 2025 13:37:26 -0800 Subject: [PATCH 5/6] . --- .../__tests__/AddEditAllocationAgreements.test.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx index e41d63c24..7cf568527 100644 --- a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx +++ b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx @@ -47,7 +47,7 @@ vi.mock('react-i18next', () => ({ // Handle other keys with or without options switch (key) { - case 'allocationAgreement:addAllocationAgreementRowsTitle': + case 'allocationAgreement:allocationAgreementTitle': return 'Add Allocation Agreement Rows' case 'allocationAgreement:noAllocationAgreementsFound': return 'No Allocation Agreements Found' @@ -126,7 +126,7 @@ describe('AddEditAllocationAgreements', () => { it('renders the component', () => { render(, { wrapper }) expect( - screen.getByText('allocationAgreement:addAllocationAgreementRowsTitle') + screen.getByText('allocationAgreement:allocationAgreementTitle') ).toBeInTheDocument() }) From 3d828dadfccbbe6e92dcc4fe7e505eba7c8eaad4 Mon Sep 17 00:00:00 2001 From: prv-proton Date: Thu, 9 Jan 2025 13:46:27 -0800 Subject: [PATCH 6/6] . --- .../__tests__/AddEditAllocationAgreements.test.jsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx index 7cf568527..9a37d2c32 100644 --- a/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx +++ b/frontend/src/views/AllocationAgreements/__tests__/AddEditAllocationAgreements.test.jsx @@ -44,16 +44,7 @@ vi.mock('react-i18next', () => ({ ) { return ['Guide 1', 'Guide 2', 'Guide 3'] // Mocked guide objects } - - // Handle other keys with or without options - switch (key) { - case 'allocationAgreement:allocationAgreementTitle': - return 'Add Allocation Agreement Rows' - case 'allocationAgreement:noAllocationAgreementsFound': - return 'No Allocation Agreements Found' - default: - return key // Fallback to returning the key - } + return key }) }) }))