Skip to content

Commit

Permalink
fix: TypedSignDecoded revoke
Browse files Browse the repository at this point in the history
  • Loading branch information
digiwand committed Feb 21, 2025
1 parent a9cd3af commit f60242e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ const stateChangesApprove = [
},
];

const stateChangesRevoke = [
{
assetType: 'ERC20',
changeType: DecodingDataChangeType.Revoke,
address: '0x3fc91a3afd70395cd496c647d5a6cc9d4b2b7fad',
amount: '12345',
contractAddress: '0x6b175474e89094c44da98b954eedeac495271d0f',
},
];

const stateChangesListingERC1155: DecodingDataStateChanges = [
{
assetType: 'NATIVE',
Expand Down Expand Up @@ -112,6 +122,17 @@ describe('DecodedSimulation', () => {
await waitFor(() => expect(getByText('12,345')).toBeDefined());
});

it('renders for ERC20 revoke', async () => {
const { getByText } = renderWithProvider(<TypedSignDecoded />, {
state: mockState(stateChangesRevoke),
});

expect(await getByText('Estimated changes')).toBeDefined();
expect(await getByText('Revoke')).toBeDefined();

await waitFor(() => expect(getByText('12,345')).toBeDefined());
});

it('renders "Unlimited" for large values', async () => {
const { getByText } = renderWithProvider(<TypedSignDecoded />, {
state: mockState([{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const getStateChangeLabelMap = (
? strings('confirm.simulation.label_change_type_nft_listing')
: strings('confirm.simulation.label_change_type_receive'),
[DecodingDataChangeType.Approve]: strings('confirm.simulation.label_change_type_permit'),
[DecodingDataChangeType.Revoke]: strings('confirm.simulation.label_change_type_permit'),
[DecodingDataChangeType.Revoke]: strings('confirm.simulation.label_change_type_revoke'),
[DecodingDataChangeType.Bidding]: strings('confirm.simulation.label_change_type_bidding'),
[DecodingDataChangeType.Listing]: strings('confirm.simulation.label_change_type_listing'),
}[changeType]);
Expand Down

0 comments on commit f60242e

Please sign in to comment.