* fix: remove show market only checkbox * chore: fix tests * chore: lint fix Co-authored-by: Rado <szpiechrados@gmail.com>
This commit is contained in:
parent
6d646e3baf
commit
dce802d153
@ -1,6 +1,5 @@
|
||||
import { aliasQuery, mockConnectWallet } from '@vegaprotocol/cypress';
|
||||
import { mockConnectWallet } from '@vegaprotocol/cypress';
|
||||
import { connectEthereumWallet } from '../support/ethereum-wallet';
|
||||
import { generateNetworkParameters } from '../support/mocks/generate-network-parameters';
|
||||
|
||||
const connectEthWalletBtn = 'connect-eth-wallet-btn';
|
||||
const connectVegaBtn = 'connect-vega-wallet';
|
||||
@ -98,9 +97,7 @@ describe('ethereum wallet', { tags: '@smoke' }, () => {
|
||||
cy.mockWeb3Provider();
|
||||
// Using portfolio withdrawals tab is it requires Ethereum wallet connection
|
||||
cy.visit('/#/portfolio');
|
||||
cy.mockGQL((req) => {
|
||||
aliasQuery(req, 'NetworkParams', generateNetworkParameters());
|
||||
});
|
||||
cy.mockTradingPage();
|
||||
cy.mockGQLSubscription();
|
||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||
cy.connectVegaWallet();
|
||||
|
@ -91,17 +91,11 @@ describe('orders list', { tags: '@smoke' }, () => {
|
||||
});
|
||||
|
||||
it('orders are sorted by most recent order', () => {
|
||||
const expectedOrderList = [
|
||||
'BTCUSD.MF21',
|
||||
'SOLUSD',
|
||||
'AAPL.MF21',
|
||||
'ETHBTC.QM21',
|
||||
'ETHBTC.QM21',
|
||||
];
|
||||
const expectedOrderList = ['BTCUSD.MF21', 'BTCUSD.MF21'];
|
||||
|
||||
cy.getByTestId('tab-orders')
|
||||
.get(`.ag-center-cols-container [col-id='${orderSymbol}']`)
|
||||
.should('have.length.at.least', 5)
|
||||
.should('have.length.at.least', expectedOrderList.length)
|
||||
.then(($symbols) => {
|
||||
const symbolNames: string[] = [];
|
||||
cy.wrap($symbols)
|
||||
|
38
apps/trading-e2e/src/support/mocks/generate-deposits.ts
Normal file
38
apps/trading-e2e/src/support/mocks/generate-deposits.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import merge from 'lodash/merge';
|
||||
import * as Schema from '@vegaprotocol/types';
|
||||
import type { PartialDeep } from 'type-fest';
|
||||
import type { DepositsQuery } from '@vegaprotocol/deposits';
|
||||
|
||||
export const generateDeposits = (
|
||||
override?: PartialDeep<DepositsQuery>
|
||||
): DepositsQuery => {
|
||||
const defaultAccounts: DepositsQuery = {
|
||||
__typename: 'Query',
|
||||
party: {
|
||||
__typename: 'Party',
|
||||
id: Cypress.env('VEGA_PUBLIC_KEY'),
|
||||
depositsConnection: {
|
||||
__typename: 'DepositsConnection',
|
||||
edges: [
|
||||
{
|
||||
__typename: 'DepositEdge',
|
||||
node: {
|
||||
__typename: 'Deposit',
|
||||
id: 'deposit-0',
|
||||
status: Schema.DepositStatus.STATUS_OPEN,
|
||||
amount: '100000000',
|
||||
asset: {
|
||||
__typename: 'Asset',
|
||||
id: 'asset-0',
|
||||
symbol: 'BTC',
|
||||
decimals: 8,
|
||||
},
|
||||
createdTimestamp: '2021-06-01T00:00:00.000Z',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
return merge(defaultAccounts, override);
|
||||
};
|
@ -75,7 +75,7 @@ export const generateOrders = (
|
||||
id: '94737d2bafafa4bc3b80a56ef084ae52a983b91aa067c31e243c61a0f962a836',
|
||||
market: {
|
||||
__typename: 'Market',
|
||||
id: 'market-3',
|
||||
id: 'market-0',
|
||||
},
|
||||
size: '1',
|
||||
type: Schema.OrderType.TYPE_LIMIT,
|
||||
@ -96,7 +96,7 @@ export const generateOrders = (
|
||||
id: '94aead3ca92dc932efcb503631b03a410e2a5d4606cae6083e2406dc38e52f78',
|
||||
market: {
|
||||
__typename: 'Market',
|
||||
id: 'market-3',
|
||||
id: 'market-0',
|
||||
},
|
||||
size: '10',
|
||||
type: Schema.OrderType.TYPE_LIMIT,
|
||||
|
@ -27,6 +27,7 @@ import {
|
||||
import { generateMarketProposals } from './mocks/generate-proposals';
|
||||
import { generateStatistics } from './mocks/generate-statistics';
|
||||
import { generateChainId } from './mocks/generate-chain-id';
|
||||
import { generateDeposits } from './mocks/generate-deposits';
|
||||
|
||||
const mockTradingPage = (
|
||||
req: CyHttpMessages.IncomingHttpRequest,
|
||||
@ -98,6 +99,7 @@ const mockTradingPage = (
|
||||
aliasQuery(req, 'MarketPositions', generatePositions());
|
||||
aliasQuery(req, 'PartyMarketData', generatePartyMarketData());
|
||||
aliasQuery(req, 'ProposalsList', generateMarketProposals());
|
||||
aliasQuery(req, 'Deposits', generateDeposits());
|
||||
};
|
||||
|
||||
declare global {
|
||||
|
@ -72,7 +72,6 @@ const MainGrid = ({
|
||||
marketId: string;
|
||||
onSelect?: (marketId: string) => void;
|
||||
}) => {
|
||||
const [showMarketOnly, setShowMarketOnly] = useState(false);
|
||||
return (
|
||||
<ResizableGrid vertical>
|
||||
<ResizableGridPanel minSize={75} priority={LayoutPriority.High}>
|
||||
@ -149,32 +148,12 @@ const MainGrid = ({
|
||||
</Tab>
|
||||
<Tab id="orders" name={t('Orders')}>
|
||||
<VegaWalletContainer>
|
||||
<label className="flex align-right whitespace-nowrap overflow-hidden text-ellipsis m-1 text-xs">
|
||||
<input
|
||||
className="mr-1"
|
||||
type="checkbox"
|
||||
checked={showMarketOnly}
|
||||
onChange={() => setShowMarketOnly(!showMarketOnly)}
|
||||
/>
|
||||
{t('Show orders for this market only')}
|
||||
</label>
|
||||
<TradingViews.Orders
|
||||
marketId={showMarketOnly ? marketId : ''}
|
||||
/>
|
||||
<TradingViews.Orders marketId={marketId} />
|
||||
</VegaWalletContainer>
|
||||
</Tab>
|
||||
<Tab id="fills" name={t('Fills')}>
|
||||
<VegaWalletContainer>
|
||||
<label className="flex align-right whitespace-nowrap overflow-hidden text-ellipsis m-1 text-xs">
|
||||
<input
|
||||
className="mr-1"
|
||||
type="checkbox"
|
||||
checked={showMarketOnly}
|
||||
onChange={() => setShowMarketOnly(!showMarketOnly)}
|
||||
/>
|
||||
{t('Show fills for this market only')}
|
||||
</label>
|
||||
<TradingViews.Fills marketId={showMarketOnly ? marketId : ''} />
|
||||
<TradingViews.Fills marketId={marketId} />
|
||||
</VegaWalletContainer>
|
||||
</Tab>
|
||||
<Tab id="accounts" name={t('Collateral')}>
|
||||
|
Loading…
Reference in New Issue
Block a user