From e7a7b428a10af9ac4e0916db4aca89814220f6af Mon Sep 17 00:00:00 2001 From: heorhi-deriv Date: Thu, 21 Nov 2024 10:33:28 +0300 Subject: [PATCH] chore: fix npm script, add error in test to check --- package.json | 2 +- .../__tests__/account-transfer.spec.tsx | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 7731dcca2fc2..926e6c615009 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "test": "f () { npm run test:stylelint && npm run test:eslint-all && npm run test:jest ;}; f", "test:stylelint": "stylelint \"./packages/*/src/**/*.s(a|c)ss\"", "test:ci": "f () { npm run test:stylelint && npm run test:eslint-all ;}; f", - "test:shard": "jest --all --shard=${SHARD_INDEX}/${SHARD_COUNT} --maxWorkers=${JEST_MAX_WORKERS:-'50%'} --coverage", + "test:shard": "jest --all --shard=${SHARD_INDEX}/${SHARD_COUNT} --maxWorkers=${JEST_MAX_WORKERS:-'50%'}", "test:jest": "jest --all --maxWorkers=${JEST_MAX_WORKERS:-'50%'}", "test:performance": "cd e2e-tests && jest -c ./jest.config.js --detectOpenHandles performance", "stylelint:fix": "stylelint \"./packages/*/src/**/*.s(a|c)ss\" --fix", diff --git a/packages/cashier/src/pages/account-transfer/__tests__/account-transfer.spec.tsx b/packages/cashier/src/pages/account-transfer/__tests__/account-transfer.spec.tsx index 5b53f3a56631..ddce5215e92f 100644 --- a/packages/cashier/src/pages/account-transfer/__tests__/account-transfer.spec.tsx +++ b/packages/cashier/src/pages/account-transfer/__tests__/account-transfer.spec.tsx @@ -1,11 +1,13 @@ import React from 'react'; -import { render, screen, waitFor } from '@testing-library/react'; import { Router } from 'react-router'; -import { useCashierLocked, useTradingPlatformStatus } from '@deriv/hooks'; import { createBrowserHistory } from 'history'; -import AccountTransfer from '../account-transfer'; -import CashierProviders from '../../../cashier-providers'; + +import { useCashierLocked, useTradingPlatformStatus } from '@deriv/hooks'; import { mockStore } from '@deriv/stores'; +import { render, screen, waitFor } from '@testing-library/react'; + +import CashierProviders from '../../../cashier-providers'; +import AccountTransfer from '../account-transfer'; jest.mock('@deriv/shared/src/services/ws-methods', () => ({ __esModule: true, @@ -112,7 +114,7 @@ describe('', () => { mockRootStore.modules.cashier.account_transfer.is_transfer_locked = true; renderAccountTransfer(); - expect(await screen.findByText('Transfers are locked')).toBeInTheDocument(); + expect(await screen.findByText('Transfers are locked!')).toBeInTheDocument(); }); it('renders the error component if there are errors when transferring between accounts', async () => {