Skip to content

Conversation

@arhtudormorar
Copy link
Contributor

Extend tests

@gemini-code-assist
Copy link

Summary of Changes

Hello @arhtudormorar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the project's test suite by introducing new unit tests for critical utility functions and error handling logic. The changes aim to bolster the reliability and maintainability of the codebase, particularly in areas concerning transaction processing, value interpretation, and user feedback mechanisms. This proactive approach to testing helps ensure that core functionalities behave as expected and provides a safety net for future development.

Highlights

  • Increased Test Coverage: The overall test coverage has improved from 87.98% to 88.29%, indicating a more thoroughly tested codebase.
  • Comprehensive Error Handling Tests: New tests were added for handleSignError, ensuring robust and consistent error messaging and toast notifications for transaction signing issues.
  • Enhanced Transaction Value Interpretation Tests: A suite of tests was introduced for functions related to extracting and formatting transaction values, including getEgldValueData, getValueFromActions, getValueFromDataField, and getValueFromOperations.
  • Improved Token and NFT Display Logic Tests: New tests cover the logic for generating display text for various token types, including NFTs, through getTitleText and getTransactionActionNftText.
  • Transaction History Utility Tests: Tests were added for getTransactionsHistory and its helper getVisibleOperations, verifying the correct processing and filtering of transaction data for history display.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly extends the test coverage by adding new test files for various helper functions. The new tests are well-structured and improve the overall quality and reliability of the codebase. I've provided a couple of suggestions to further improve the assertions and clarity in one of the new test files.

Comment on lines +62 to +63
expect(decodeURI(result)).toContain('WEGLD');
expect(decodeURI(result)).toContain('USDC');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The decodeURI call here is redundant because the getTitleText function already returns a decoded string. Removing this will make the test assertions clearer and more direct.

Suggested change
expect(decodeURI(result)).toContain('WEGLD');
expect(decodeURI(result)).toContain('USDC');
expect(result).toContain('WEGLD');
expect(result).toContain('USDC');


expect(result).toContain('WEGLD');
expect(result).toContain('WEGLD-d7c6bb');
expect(result).toBeTruthy();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The assertion expect(result).toBeTruthy() is too generic and doesn't effectively test the behavior for decimals: 0. A more specific assertion would make this test more robust by verifying that the large number is formatted as expected. For example, you could check that the result contains the formatted value.

Suggested change
expect(result).toBeTruthy();
expect(result).toContain('1,000,000,000,000,000,000');

@arhtudormorar arhtudormorar merged commit a695230 into development Nov 27, 2025
2 checks passed
@arhtudormorar arhtudormorar deleted the tm/feature/extend-tests-5 branch November 27, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants