* Show custom tokens in Swaps
* Add messages for adding a custom token in Swaps
* Add the first version of importing custom tokens in swaps
* Fix lint rules
* Create a new component: ImportToken
* Remove a pointer cursor from regular heading
* Fix a CSS issue for tokens with long names
* Update a comment
* Don’t return a custom token if it doesn’t have symbol or decimals
* Only search by contract address if nothing was found
* Track “Token Imported” event
* Fix unit tests
* Import tracking for “Token Imported”, increase token icon font size
* Disable token import for Source Token
* Update logic and content for notifications, update tests
* Do not hide a dropdown placeholder on click, so a user can click on a link
* Update a key name
* Update styling for the “danger” type notification in Swaps
* Show either a warning or danger notification based on token verification occurences
* Remove testnets from SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP
* Use the “shouldSearchForImports” prop
* Create a new function for handling token import: “onOpenImportTokenModalClick”
* Filter token duplicities before iterating over tokens
* Use “address” instead of “symbol” for checking uniqueness
* Trigger Build
* Use a new API (/token) to get token data for importing in Swaps
* Temporarily decrese Jest threshold for functions
* Swaps: Show a network name dynamically in a tooltip
* Replace “Ethereum” with “$1”, change “Test” to “Testnet”
* Replace 이더리움 with $1
* Translate network names, use ‘Ethereum’ by default if a translation is not available yet
* Reorder messages to resolve ESLint issues
* Add a snapshot test for the FeeCard component, increase Jest threshold
* Enable snapshot testing into external .snap files in ESLint
* Add the “networkNameEthereum” key in ko/messages.json, remove default “Ethereum” value
* Throw an error if chain ID is not supported by the Swaps feature
* Use string literals when calling the `t` fn,
* Watch Jest tests silently (no React warnings in terminal, only errors)
* Add @testing-library/jest-dom, import it before running Jest tests
* Add snapshot testing of Swaps’ React components for happy paths, increase minimum threshold for Jest
* Add the test/jest folder for Jest setup and shared functions, use it in Swaps Jest tests
* Fix ESLint issues, update linting config
* Enable ESLint for .snap files (Jest snapshots), throw an error if a snapshot is bigger than 50 lines
* Don’t run lint:fix for .snap files
* Move `createProps` outside of `describe` blocks, move store creation inside tests
* Use translations instead of keys, update a rendering function to load translations
* Make sure all Jest snapshots are shorter than 50 lines (default limit)
* Add / update props for Swaps tests
* Fix React warnings when running tests for Swaps
* Swaps: Show a network name dynamically in a tooltip
* Replace “Ethereum” with “$1”, change “Test” to “Testnet”
* Replace 이더리움 with $1
* Translate network names, use ‘Ethereum’ by default if a translation is not available yet
* Reorder messages to resolve ESLint issues
* Add a snapshot test for the FeeCard component, increase Jest threshold
* Enable snapshot testing into external .snap files in ESLint
* Add the “networkNameEthereum” key in ko/messages.json, remove default “Ethereum” value
* Throw an error if chain ID is not supported by the Swaps feature
* Use string literals when calling the `t` fn,
* Remove periodic calls to the /featureFlag API
* Always show the Swap button on the main page
* Check if the Swaps feature is enabled, show loading animation while waiting
* Reuse an existing useEffect call
* Use ‘isFeatureFlagLoaded’ in React’s state, resolve lint issues
* Add a watch mode for Jest testing
* Add unit tests for Swaps: fetchSwapsLiveness, add /ducks/swaps into Jest testing
* Remove Swaps Jest tests from Mocha’s ESLint rules
* Ignore Swaps Jest tests while running Mocha, update paths
* Increase test coverage to the current max
* Fix ESLint issues for Swaps
* Enable the Swaps feature by default and after state reset, remove loading screen before seeing Swaps
* Update Jest config, fix tests
* Update Jest coverage threshold to the current maximum
* Update ESLint rule in jest.config.js
* Disable the “Review Swap” button if the feature flag hasn’t loaded yet
* Update jest threshold
* Add jest coverage
This will add coverage for any tests ran in jest under the `test:coverage:jest` command, which is currently being used in CI. I set the values to the current test coverage in `ui/app/pages/swaps`.
* Lint
* Setup jest config
* Adjust test for jest.
* Adjust lint config
* Omit swaps ui folder for unit testing
* Omit swaps from test:unit:lax
* Add jest.config.js to script files
* Restore mocks rather than clearing them.
* Update jest config and adjust lint to include subdirs
* Convert view-quote-price-difference test to jest
* Add jest ci and ci coverage scripts. Add jest unit test to general test command
* Add test coverage to ci
* Use --ignore flag
* Fixup
* Add @metamask/eslint-config-jest
* Update .eslintrc.js
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* Adds jest-coverage/
Co-authored-by: Mark Stacey <markjstacey@gmail.com>