diff --git a/src/constants/stubs.ts b/src/constants/stubs.ts index ff38d5c60..e77bb7128 100644 --- a/src/constants/stubs.ts +++ b/src/constants/stubs.ts @@ -14,11 +14,7 @@ import type { PopupType, TxFunctionParsed, } from '@/types'; -import { CoinGeckoMarketResponse } from '@/lib/CoinGecko'; -import { - AE_COINGECKO_COIN_ID, - AE_CONTRACT_ID, -} from '@/protocols/aeternity/config'; +import { AE_CONTRACT_ID } from '@/protocols/aeternity/config'; import { POPUP_TYPE_ACCOUNT_LIST, POPUP_TYPE_CONNECT, @@ -50,10 +46,6 @@ export const STUB_ACCOUNT = { export const recipientId: Encoded.AccountAddress = 'ak_2ELPCWzcTdiyYuumjaV4D7kE843d1Ts27zH1Y2LBMKDbNtfq1Q'; export const contractCallAddress: Encoded.ContractAddress = 'ct_ym8eXWR2YfQZcMaXA8GFid9aarfCozGkeMcRHYVCVoBdVMzio'; -export const STUB_CURRENCY: CoinGeckoMarketResponse = { - id: AE_COINGECKO_COIN_ID, symbol: 'ae', name: 'Aeternity', image: 'https://assets.coingecko.com/coins/images/1091/large/aeternity.png?1547035060', currentPrice: 0.076783, marketCap: 31487891, marketCapRank: 523, fullyDilutedValuation: null, totalVolume: 217034, high24h: 0.078539, low24h: 0.076793, priceChange24h: -0.001092194951687525, priceChangePercentage24h: -1.4025, marketCapChange24h: -429134.39267925173, marketCapChangePercentage24h: -1.34453, circulatingSupply: 409885828.49932, totalSupply: 536306702.0, maxSupply: null, ath: 5.69, athChangePercentage: -98.65091, athDate: '2018-04-29T03:50:39.593Z', atl: 0.059135, atlChangePercentage: 29.84246, atlDate: '2020-03-13T02:29:11.856Z', roi: { times: -0.725775445642378, currency: 'usd', percentage: -72.57754456423778 }, lastUpdated: '2023-01-17T11:38:23.610Z', -}; - export const STUB_APP_DATA: IAppData = { href: 'http://localhost:5000/aepp/aepp', name: 'AEPP', diff --git a/tests/e2e/support/commands.js b/tests/e2e/support/commands.js index a036bfcbd..6d55e7537 100644 --- a/tests/e2e/support/commands.js +++ b/tests/e2e/support/commands.js @@ -6,7 +6,7 @@ import { PROTOCOLS, STORAGE_KEYS, } from '@/constants'; -import { STUB_CURRENCY, STUB_ACCOUNT } from '@/constants/stubs'; +import { STUB_ACCOUNT } from '@/constants/stubs'; import { generateEncryptionKey, encrypt, @@ -16,7 +16,6 @@ import { generateSalt, prepareStorageKey, } from '@/utils'; -import { CoinGecko } from '../../../src/lib/CoinGecko'; export function preparePendingTransactionToLocalStorage(pendingTransaction) { const { address } = STUB_ACCOUNT; @@ -73,11 +72,6 @@ Cypress.Commands.add('shouldHasErrorMessage', (el) => { cy.get(el).should('exist').should('be.visible'); }); -Cypress.Commands.add('mockExternalRequests', () => { - cy.stub(CoinGecko, 'fetchCoinMarketData', STUB_CURRENCY); - cy.stub(CoinGecko, 'fetchCoinCurrencyRates', { usd: 0.05 }); -}); - Cypress.Commands.add('loginUsingPassword', () => { cy.get('[data-cy=password] input') .should('be.visible') @@ -87,15 +81,13 @@ Cypress.Commands.add('loginUsingPassword', () => { .click(); }); -Cypress.Commands.add('login', (options, route, isMockingExternalRequests = true) => { +Cypress.Commands.add('login', (options, route) => { cy.then(async () => { const salt = generateSalt(); const encryptionKey = await generateEncryptionKey(STUB_ACCOUNT.password, salt); const mnemonicEncryptionResult = await encrypt(encryptionKey, STUB_ACCOUNT.mnemonic); return [mnemonicEncryptionResult, salt]; }).then(([mnemonicEncryptionResult, salt]) => { - if (isMockingExternalRequests) cy.mockExternalRequests(); - const { isSeedBackedUp = false, pendingTransaction, network = null } = options || {}; cy.openPopup(async (contentWindow) => {