* 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 { connectEthereumWallet } from '../support/ethereum-wallet';
|
||||||
import { generateNetworkParameters } from '../support/mocks/generate-network-parameters';
|
|
||||||
|
|
||||||
const connectEthWalletBtn = 'connect-eth-wallet-btn';
|
const connectEthWalletBtn = 'connect-eth-wallet-btn';
|
||||||
const connectVegaBtn = 'connect-vega-wallet';
|
const connectVegaBtn = 'connect-vega-wallet';
|
||||||
@ -98,9 +97,7 @@ describe('ethereum wallet', { tags: '@smoke' }, () => {
|
|||||||
cy.mockWeb3Provider();
|
cy.mockWeb3Provider();
|
||||||
// Using portfolio withdrawals tab is it requires Ethereum wallet connection
|
// Using portfolio withdrawals tab is it requires Ethereum wallet connection
|
||||||
cy.visit('/#/portfolio');
|
cy.visit('/#/portfolio');
|
||||||
cy.mockGQL((req) => {
|
cy.mockTradingPage();
|
||||||
aliasQuery(req, 'NetworkParams', generateNetworkParameters());
|
|
||||||
});
|
|
||||||
cy.mockGQLSubscription();
|
cy.mockGQLSubscription();
|
||||||
cy.get('main[data-testid="/portfolio"]').should('exist');
|
cy.get('main[data-testid="/portfolio"]').should('exist');
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
|
@ -91,17 +91,11 @@ describe('orders list', { tags: '@smoke' }, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('orders are sorted by most recent order', () => {
|
it('orders are sorted by most recent order', () => {
|
||||||
const expectedOrderList = [
|
const expectedOrderList = ['BTCUSD.MF21', 'BTCUSD.MF21'];
|
||||||
'BTCUSD.MF21',
|
|
||||||
'SOLUSD',
|
|
||||||
'AAPL.MF21',
|
|
||||||
'ETHBTC.QM21',
|
|
||||||
'ETHBTC.QM21',
|
|
||||||
];
|
|
||||||
|
|
||||||
cy.getByTestId('tab-orders')
|
cy.getByTestId('tab-orders')
|
||||||
.get(`.ag-center-cols-container [col-id='${orderSymbol}']`)
|
.get(`.ag-center-cols-container [col-id='${orderSymbol}']`)
|
||||||
.should('have.length.at.least', 5)
|
.should('have.length.at.least', expectedOrderList.length)
|
||||||
.then(($symbols) => {
|
.then(($symbols) => {
|
||||||
const symbolNames: string[] = [];
|
const symbolNames: string[] = [];
|
||||||
cy.wrap($symbols)
|
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',
|
id: '94737d2bafafa4bc3b80a56ef084ae52a983b91aa067c31e243c61a0f962a836',
|
||||||
market: {
|
market: {
|
||||||
__typename: 'Market',
|
__typename: 'Market',
|
||||||
id: 'market-3',
|
id: 'market-0',
|
||||||
},
|
},
|
||||||
size: '1',
|
size: '1',
|
||||||
type: Schema.OrderType.TYPE_LIMIT,
|
type: Schema.OrderType.TYPE_LIMIT,
|
||||||
@ -96,7 +96,7 @@ export const generateOrders = (
|
|||||||
id: '94aead3ca92dc932efcb503631b03a410e2a5d4606cae6083e2406dc38e52f78',
|
id: '94aead3ca92dc932efcb503631b03a410e2a5d4606cae6083e2406dc38e52f78',
|
||||||
market: {
|
market: {
|
||||||
__typename: 'Market',
|
__typename: 'Market',
|
||||||
id: 'market-3',
|
id: 'market-0',
|
||||||
},
|
},
|
||||||
size: '10',
|
size: '10',
|
||||||
type: Schema.OrderType.TYPE_LIMIT,
|
type: Schema.OrderType.TYPE_LIMIT,
|
||||||
|
@ -27,6 +27,7 @@ import {
|
|||||||
import { generateMarketProposals } from './mocks/generate-proposals';
|
import { generateMarketProposals } from './mocks/generate-proposals';
|
||||||
import { generateStatistics } from './mocks/generate-statistics';
|
import { generateStatistics } from './mocks/generate-statistics';
|
||||||
import { generateChainId } from './mocks/generate-chain-id';
|
import { generateChainId } from './mocks/generate-chain-id';
|
||||||
|
import { generateDeposits } from './mocks/generate-deposits';
|
||||||
|
|
||||||
const mockTradingPage = (
|
const mockTradingPage = (
|
||||||
req: CyHttpMessages.IncomingHttpRequest,
|
req: CyHttpMessages.IncomingHttpRequest,
|
||||||
@ -98,6 +99,7 @@ const mockTradingPage = (
|
|||||||
aliasQuery(req, 'MarketPositions', generatePositions());
|
aliasQuery(req, 'MarketPositions', generatePositions());
|
||||||
aliasQuery(req, 'PartyMarketData', generatePartyMarketData());
|
aliasQuery(req, 'PartyMarketData', generatePartyMarketData());
|
||||||
aliasQuery(req, 'ProposalsList', generateMarketProposals());
|
aliasQuery(req, 'ProposalsList', generateMarketProposals());
|
||||||
|
aliasQuery(req, 'Deposits', generateDeposits());
|
||||||
};
|
};
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
@ -72,7 +72,6 @@ const MainGrid = ({
|
|||||||
marketId: string;
|
marketId: string;
|
||||||
onSelect?: (marketId: string) => void;
|
onSelect?: (marketId: string) => void;
|
||||||
}) => {
|
}) => {
|
||||||
const [showMarketOnly, setShowMarketOnly] = useState(false);
|
|
||||||
return (
|
return (
|
||||||
<ResizableGrid vertical>
|
<ResizableGrid vertical>
|
||||||
<ResizableGridPanel minSize={75} priority={LayoutPriority.High}>
|
<ResizableGridPanel minSize={75} priority={LayoutPriority.High}>
|
||||||
@ -149,32 +148,12 @@ const MainGrid = ({
|
|||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="orders" name={t('Orders')}>
|
<Tab id="orders" name={t('Orders')}>
|
||||||
<VegaWalletContainer>
|
<VegaWalletContainer>
|
||||||
<label className="flex align-right whitespace-nowrap overflow-hidden text-ellipsis m-1 text-xs">
|
<TradingViews.Orders marketId={marketId} />
|
||||||
<input
|
|
||||||
className="mr-1"
|
|
||||||
type="checkbox"
|
|
||||||
checked={showMarketOnly}
|
|
||||||
onChange={() => setShowMarketOnly(!showMarketOnly)}
|
|
||||||
/>
|
|
||||||
{t('Show orders for this market only')}
|
|
||||||
</label>
|
|
||||||
<TradingViews.Orders
|
|
||||||
marketId={showMarketOnly ? marketId : ''}
|
|
||||||
/>
|
|
||||||
</VegaWalletContainer>
|
</VegaWalletContainer>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="fills" name={t('Fills')}>
|
<Tab id="fills" name={t('Fills')}>
|
||||||
<VegaWalletContainer>
|
<VegaWalletContainer>
|
||||||
<label className="flex align-right whitespace-nowrap overflow-hidden text-ellipsis m-1 text-xs">
|
<TradingViews.Fills marketId={marketId} />
|
||||||
<input
|
|
||||||
className="mr-1"
|
|
||||||
type="checkbox"
|
|
||||||
checked={showMarketOnly}
|
|
||||||
onChange={() => setShowMarketOnly(!showMarketOnly)}
|
|
||||||
/>
|
|
||||||
{t('Show fills for this market only')}
|
|
||||||
</label>
|
|
||||||
<TradingViews.Fills marketId={showMarketOnly ? marketId : ''} />
|
|
||||||
</VegaWalletContainer>
|
</VegaWalletContainer>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab id="accounts" name={t('Collateral')}>
|
<Tab id="accounts" name={t('Collateral')}>
|
||||||
|
Loading…
Reference in New Issue
Block a user