Files
valleXYZandGitHub cc12646b7a fix: disable trusted token filtering without portfolio support (#7648)
* fix: disable trusted token filtering without portfolio support

* tests: adapt assets smoke for non-portfolio token lists
2026-06-03 10:16:20 +02:00

57 lines
1.9 KiB
JavaScript

import * as constants from '../../support/constants'
import * as main from '../../e2e/pages/main.page'
import * as assets from '../pages/assets.pages'
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
import * as ls from '../../support/localstorage_data.js'
let staticSafes = []
describe('[SMOKE] Assets tests', () => {
const fiatRegex = assets.fiatRegex
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
beforeEach(() => {
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2)
})
it('[SMOKE] Verify that the native token is visible', () => {
assets.verifyTokenIsPresent(constants.tokenNames.sepoliaEther)
})
it('[SMOKE] Verify that the token tab is selected by default and the table is visible', () => {
assets.verifyTokensTabIsSelected('true')
})
it('[SMOKE] Verify token list filter and dust filter functionality', () => {
let spamTokens = [
assets.currencyAave,
assets.currencyTestTokenA,
assets.currencyTestTokenB,
assets.currencyUSDC,
assets.currencyLink,
assets.currencyDaiCap,
]
// Disable dust filter to see tokens with no fiat value
assets.toggleHideDust(false)
// On chains without portfolio support, trusted filtering is disabled.
// "Default tokens" therefore behaves like "all tokens".
assets.toggleShowAllTokens(false)
main.verifyValuesExist(assets.tokenListTable, [constants.tokenNames.sepoliaEther, ...spamTokens])
// Verify toggling "Show all tokens" still keeps the full list visible
assets.toggleShowAllTokens(true)
spamTokens.push(constants.tokenNames.sepoliaEther)
main.verifyValuesExist(assets.tokenListTable, spamTokens)
// Verify dust filter hides tokens with no value
assets.toggleHideDust(true)
main.verifyValuesExist(assets.tokenListTable, [constants.tokenNames.sepoliaEther])
main.verifyValuesDoNotExist(assets.tokenListTable, [assets.currencyAave])
})
})