From fd3dcbde0fd65113fa21a10f0ed0740f356cd0c4 Mon Sep 17 00:00:00 2001 From: "przemyslaw.wlodek" Date: Fri, 24 Nov 2023 19:51:05 +0100 Subject: [PATCH] fix(extension): translation keys casing and unit tests --- .../ConfirmDRepRegistrationContainer.test.tsx | 10 +++++----- .../ConfirmDRepRetirementContainer.test.tsx | 10 +++++----- .../ConfirmDRepUpdateContainer.test.tsx | 8 ++++---- .../ConfirmVoteDelegationContainer.test.tsx | 10 +++++----- .../VotingProceduresContainer.test.tsx | 18 +++++++++--------- .../__tests__/utils.test.tsx | 4 ++-- .../components/confirm-transaction/utils.ts | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRegistrationContainer.test.tsx b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRegistrationContainer.test.tsx index 13619e395b..d63017f1e1 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRegistrationContainer.test.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRegistrationContainer.test.tsx @@ -161,12 +161,12 @@ describe('Testing ConfirmDRepRegistrationContainer component', () => { url: certificate.anchor?.url }, translations: { - metadata: t('core.drepRegistration.metadata'), + metadata: t('core.DRepRegistration.metadata'), labels: { - depositPaid: t('core.drepRegistration.depositPaid'), - drepId: t('core.drepRegistration.drepId'), - hash: t('core.drepRegistration.hash'), - url: t('core.drepRegistration.url') + depositPaid: t('core.DRepRegistration.depositPaid'), + drepId: t('core.DRepRegistration.drepId'), + hash: t('core.DRepRegistration.hash'), + url: t('core.DRepRegistration.url') } }, errorMessage diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRetirementContainer.test.tsx b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRetirementContainer.test.tsx index 3e0cae4ebf..bb0fe2b214 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRetirementContainer.test.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepRetirementContainer.test.tsx @@ -173,10 +173,10 @@ describe('Testing ConfirmDRepRetirementContainer component', () => { drepId: Cardano.DRepID(HexBlob.toTypedBech32('drep', Wallet.HexBlob(certificate.dRepCredential.hash))) }, translations: { - metadata: t('core.drepRetirement.metadata'), + metadata: t('core.DRepRetirement.metadata'), labels: { - depositReturned: t('core.drepRetirement.depositReturned'), - drepId: t('core.drepRetirement.drepId') + depositReturned: t('core.DRepRetirement.depositReturned'), + drepId: t('core.DRepRetirement.drepId') } }, errorMessage @@ -198,7 +198,7 @@ describe('Testing ConfirmDRepRetirementContainer component', () => { expect(queryByTestId('ConfirmDRepRetirementContainer')).toBeInTheDocument(); expect( mockConfirmDRepRetirement.mock.calls[mockConfirmDRepRetirement.mock.calls.length - 1][0].errorMessage - ).toEqual(t('core.drepRetirement.isOwnRetirement')); + ).toEqual(t('core.DRepRetirement.isOwnRetirement')); }); test('should render ConfirmDRepRetirementContainer component with proper error for not own retirement', async () => { @@ -215,6 +215,6 @@ describe('Testing ConfirmDRepRetirementContainer component', () => { expect( mockConfirmDRepRetirement.mock.calls[mockConfirmDRepRetirement.mock.calls.length - 1][0].errorMessage - ).toEqual(t('core.drepRetirement.isNotOwnRetirement')); + ).toEqual(t('core.DRepRetirement.isNotOwnRetirement')); }); }); diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepUpdateContainer.test.tsx b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepUpdateContainer.test.tsx index 17c4e55e09..eba21c3337 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepUpdateContainer.test.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmDRepUpdateContainer.test.tsx @@ -153,11 +153,11 @@ describe('Testing ConfirmDRepUpdateContainer component', () => { url: certificate.anchor?.url }, translations: { - metadata: t('core.drepUpdate.metadata'), + metadata: t('core.DRepUpdate.metadata'), labels: { - drepId: t('core.drepUpdate.drepId'), - hash: t('core.drepUpdate.hash'), - url: t('core.drepUpdate.url') + drepId: t('core.DRepUpdate.drepId'), + hash: t('core.DRepUpdate.hash'), + url: t('core.DRepUpdate.url') } }, errorMessage diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmVoteDelegationContainer.test.tsx b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmVoteDelegationContainer.test.tsx index c462bfc452..dadcfafa27 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmVoteDelegationContainer.test.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/ConfirmVoteDelegationContainer.test.tsx @@ -155,12 +155,12 @@ describe('Testing ConfirmVoteDelegationContainer component', () => { ) }, translations: { - metadata: t('core.voteDelegation.metadata'), - option: t('core.voteDelegation.option'), + metadata: t('core.VoteDelegation.metadata'), + option: t('core.VoteDelegation.option'), labels: { - drepId: t('core.voteDelegation.drepId'), - alwaysAbstain: t('core.voteDelegation.alwaysAbstain'), - alwaysNoConfidence: t('core.voteDelegation.alwaysNoConfidence') + drepId: t('core.VoteDelegation.drepId'), + alwaysAbstain: t('core.VoteDelegation.alwaysAbstain'), + alwaysNoConfidence: t('core.VoteDelegation.alwaysNoConfidence') } }, errorMessage diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/VotingProceduresContainer.test.tsx b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/VotingProceduresContainer.test.tsx index 984806f75a..0a4d46b589 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/VotingProceduresContainer.test.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/VotingProceduresContainer.test.tsx @@ -230,19 +230,19 @@ describe('Testing VotingProceduresContainer component', () => { })) })), translations: { - voterType: t('core.votingProcedures.voterType'), - procedureTitle: t('core.votingProcedures.procedureTitle'), - actionIdTitle: t('core.votingProcedures.actionIdTitle'), - vote: t('core.votingProcedures.vote'), + voterType: t('core.VotingProcedures.voterType'), + procedureTitle: t('core.VotingProcedures.procedureTitle'), + actionIdTitle: t('core.VotingProcedures.actionIdTitle'), + vote: t('core.VotingProcedures.vote'), actionId: { - index: t('core.votingProcedures.actionId.index'), - txHash: t('core.votingProcedures.actionId.txHash') + index: t('core.VotingProcedures.actionId.index'), + txHash: t('core.VotingProcedures.actionId.txHash') }, anchor: { - hash: t('core.votingProcedures.anchor.hash'), - url: t('core.votingProcedures.anchor.url') + hash: t('core.VotingProcedures.anchor.hash'), + url: t('core.VotingProcedures.anchor.url') }, - dRepId: t('core.votingProcedures.dRepId') + dRepId: t('core.VotingProcedures.dRepId') }, errorMessage }, diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/utils.test.tsx b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/utils.test.tsx index 0cc51248c7..2d8a3f39ff 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/utils.test.tsx +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/__tests__/utils.test.tsx @@ -152,7 +152,7 @@ describe('Testing utils', () => { test('testing getOwnRetirementMessageKey', () => { expect(getOwnRetirementMessageKey(undefined)).toEqual(''); - expect(getOwnRetirementMessageKey(true)).toEqual('core.drepRetirement.isOwnRetirement'); - expect(getOwnRetirementMessageKey(false)).toEqual('core.drepRetirement.isNotOwnRetirement'); + expect(getOwnRetirementMessageKey(true)).toEqual('core.DRepRetirement.isOwnRetirement'); + expect(getOwnRetirementMessageKey(false)).toEqual('core.DRepRetirement.isNotOwnRetirement'); }); }); diff --git a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/utils.ts b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/utils.ts index 756fc17999..4a6e3d99d9 100644 --- a/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/utils.ts +++ b/apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/utils.ts @@ -136,5 +136,5 @@ export const getOwnRetirementMessageKey = (isOwnRetirement: boolean | undefined) if (isOwnRetirement === undefined) { return ''; } - return isOwnRetirement ? 'core.drepRetirement.isOwnRetirement' : 'core.drepRetirement.isNotOwnRetirement'; + return isOwnRetirement ? 'core.DRepRetirement.isOwnRetirement' : 'core.DRepRetirement.isNotOwnRetirement'; };