Skip to content

Commit

Permalink
Merge pull request #5473 from LiskHQ/5447-fix-zero-custom-fee
Browse files Browse the repository at this point in the history
Fix zero custom fee
  • Loading branch information
ManuGowda authored Nov 21, 2023
2 parents 5d81be5 + 65fc35b commit ca8980a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { validateAmount } from 'src/utils/validators';
import styles from './TransactionPriority.css';

const getCustomFeeStatus = ({ customFeeInput, minFee, minRequiredBalance, token }) => {
if (!customFeeInput || !token || !minRequiredBalance) return undefined;
if (!customFeeInput?.length || !token) return undefined;

const { message } = validateAmount({
amount: customFeeInput.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ describe('TransactionPriority', () => {
expect(wrapper).toContainMatchingElement('.transaction-priority');
expect(wrapper).toContainMatchingElement('.priority-selector');
expect(wrapper).toContainMatchingElement('.fee-container');

const customProps = { ...props, minRequiredBalance: 0n };
wrapper = mount(<TransactionPriority {...customProps} />);

expect(wrapper).toContainMatchingElement('.transaction-priority');
expect(wrapper).toContainMatchingElement('.priority-selector');
expect(wrapper).toContainMatchingElement('.fee-container');
});

it('renders low, medium and high processing speed options', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Carousel = ({ renderItem: RenderItem, data = [], isLoading, error, ...rest
}, []);

if (!error && !renderData.length) {
return <NoTokenBalance onRequestToken={onRequestToken} />;
return <NoTokenBalance onClick={onRequestToken} />;
}

if (error) {
Expand Down

0 comments on commit ca8980a

Please sign in to comment.