chore: fix trading app e2e tests and mocks (#1142)

* chore: fix trading app e2e tests and mocks

* chore: fix e2e build target setup and tsconfigs
This commit is contained in:
Bartłomiej Głownia 2022-08-26 18:41:47 +02:00 committed by GitHub
parent 93a5f911f5
commit 577ba28ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 60 additions and 17 deletions

View File

@ -21,6 +21,13 @@
"options": { "options": {
"lintFilePatterns": ["apps/console-lite-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/console-lite-e2e/**/*.{js,ts}"]
} }
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/console-lite-e2e/"
}
} }
}, },
"tags": [], "tags": [],

View File

@ -1,7 +1,9 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx",
"sourceMap": false, "sourceMap": false,
"allowSyntheticDefaultImports": true,
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"allowJs": true, "allowJs": true,
"types": ["cypress", "node", "cypress-real-events"] "types": ["cypress", "node", "cypress-real-events"]

View File

@ -21,6 +21,13 @@
"options": { "options": {
"lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"]
} }
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/explorer-e2e/"
}
} }
}, },
"tags": [], "tags": [],

View File

@ -1,6 +1,7 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx",
"sourceMap": false, "sourceMap": false,
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"types": ["cypress", "node"], "types": ["cypress", "node"],

View File

@ -21,6 +21,13 @@
"options": { "options": {
"lintFilePatterns": ["apps/stats-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/stats-e2e/**/*.{js,ts}"]
} }
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/stats-e2e/"
}
} }
}, },
"tags": [], "tags": [],

View File

@ -1,7 +1,9 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx",
"sourceMap": false, "sourceMap": false,
"allowSyntheticDefaultImports": true,
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"allowJs": true, "allowJs": true,
"types": ["cypress", "node"] "types": ["cypress", "node"]

View File

@ -21,6 +21,13 @@
"options": { "options": {
"lintFilePatterns": ["apps/token-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/token-e2e/**/*.{js,ts}"]
} }
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/token-e2e/"
}
} }
}, },
"tags": [], "tags": [],

View File

@ -1,7 +1,9 @@
{ {
"extends": "../../tsconfig.base.json", "extends": "../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"jsx": "react-jsx",
"sourceMap": false, "sourceMap": false,
"allowSyntheticDefaultImports": true,
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"allowJs": true, "allowJs": true,
"types": ["cypress", "node"] "types": ["cypress", "node"]

View File

@ -21,6 +21,13 @@
"options": { "options": {
"lintFilePatterns": ["apps/trading-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/trading-e2e/**/*.{js,ts}"]
} }
},
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": [],
"options": {
"command": "yarn tsc --project ./apps/trading-e2e/"
}
} }
}, },
"tags": [], "tags": [],

View File

@ -25,7 +25,7 @@ export const generateAccounts = (
}, },
{ {
__typename: 'Account', __typename: 'Account',
type: AccountType.General, type: AccountType.ACCOUNT_TYPE_GENERAL,
balance: '100000000', balance: '100000000',
market: null, market: null,
asset: { asset: {
@ -37,7 +37,7 @@ export const generateAccounts = (
}, },
{ {
__typename: 'Account', __typename: 'Account',
type: AccountType.Margin, type: AccountType.ACCOUNT_TYPE_MARGIN,
balance: '1000', balance: '1000',
market: { market: {
__typename: 'Market', __typename: 'Market',
@ -53,7 +53,7 @@ export const generateAccounts = (
}, },
{ {
__typename: 'Account', __typename: 'Account',
type: AccountType.Margin, type: AccountType.ACCOUNT_TYPE_MARGIN,
balance: '1000', balance: '1000',
market: { market: {
__typename: 'Market', __typename: 'Market',

View File

@ -13,7 +13,7 @@ export const generateMarketDepth = (
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
data: { data: {
marketTradingMode: MarketTradingMode.Continuous, marketTradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
staticMidPrice: '0', staticMidPrice: '0',
indicativePrice: '0', indicativePrice: '0',
bestStaticBidPrice: '0', bestStaticBidPrice: '0',

View File

@ -18,11 +18,6 @@ export const generateMarket = (override?: PartialDeep<Market>): Market => {
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
data: { data: {
auctionEnd: '',
auctionStart: '',
indicativePrice: '',
suppliedStake: '',
targetStake: '',
market: { market: {
id: '10cd0a793ad2887b340940337fa6d97a212e0e517fe8e9eab2b5ef3a38633f35', id: '10cd0a793ad2887b340940337fa6d97a212e0e517fe8e9eab2b5ef3a38633f35',
__typename: 'Market', __typename: 'Market',

View File

@ -16,8 +16,8 @@ export const generateMarkets = (
name: 'ACTIVE MARKET', name: 'ACTIVE MARKET',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradingMode: MarketTradingMode.Continuous, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
state: MarketState.Active, state: MarketState.STATE_ACTIVE,
marketTimestamps: { marketTimestamps: {
__typename: 'MarketTimestamps', __typename: 'MarketTimestamps',
close: '', close: '',
@ -36,7 +36,7 @@ export const generateMarkets = (
data: { data: {
market: { market: {
id: '10cd0a793ad2887b340940337fa6d97a212e0e517fe8e9eab2b5ef3a38633f35', id: '10cd0a793ad2887b340940337fa6d97a212e0e517fe8e9eab2b5ef3a38633f35',
state: MarketState.Active, state: MarketState.STATE_ACTIVE,
tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
__typename: 'Market', __typename: 'Market',
}, },
@ -49,6 +49,7 @@ export const generateMarkets = (
}, },
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
id: '',
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
name: '', name: '',
metadata: { metadata: {
@ -73,8 +74,8 @@ export const generateMarkets = (
name: 'SUSPENDED MARKET', name: 'SUSPENDED MARKET',
decimalPlaces: 2, decimalPlaces: 2,
positionDecimalPlaces: 0, positionDecimalPlaces: 0,
tradingMode: MarketTradingMode.Continuous, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
state: MarketState.Active, state: MarketState.STATE_ACTIVE,
marketTimestamps: { marketTimestamps: {
__typename: 'MarketTimestamps', __typename: 'MarketTimestamps',
close: '', close: '',
@ -106,8 +107,9 @@ export const generateMarkets = (
}, },
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
id: 'SOLUSD',
name: 'SOL/USD',
code: 'SOLUSD', code: 'SOLUSD',
name: '',
metadata: { metadata: {
__typename: 'InstrumentMetadata', __typename: 'InstrumentMetadata',
tags: [], tags: [],

View File

@ -25,6 +25,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
tradableInstrument: { tradableInstrument: {
__typename: 'TradableInstrument', __typename: 'TradableInstrument',
instrument: { instrument: {
id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'AAVEDAI.MF21', code: 'AAVEDAI.MF21',
}, },
@ -54,6 +55,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
tradableInstrument: { tradableInstrument: {
__typename: 'TradableInstrument', __typename: 'TradableInstrument',
instrument: { instrument: {
id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'TSLA.QM21', code: 'TSLA.QM21',
}, },
@ -83,6 +85,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
tradableInstrument: { tradableInstrument: {
__typename: 'TradableInstrument', __typename: 'TradableInstrument',
instrument: { instrument: {
id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'BTCUSD.MF21', code: 'BTCUSD.MF21',
}, },
@ -112,6 +115,7 @@ export const generateOrders = (override?: PartialDeep<Orders>): Orders => {
tradableInstrument: { tradableInstrument: {
__typename: 'TradableInstrument', __typename: 'TradableInstrument',
instrument: { instrument: {
id: '',
__typename: 'Instrument', __typename: 'Instrument',
code: 'UNIDAI.MF21', code: 'UNIDAI.MF21',
}, },

View File

@ -43,7 +43,7 @@ export const generatePositions = (
market: { market: {
id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d', id: 'c9f5acd348796011c075077e4d58d9b7f1689b7c1c8e030a5e886b83aa96923d',
name: 'UNIDAI Monthly (30 Jun 2022)', name: 'UNIDAI Monthly (30 Jun 2022)',
marketTradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS, tradingMode: MarketTradingMode.TRADING_MODE_CONTINUOUS,
data: { data: {
markPrice: '17588787', markPrice: '17588787',
__typename: 'MarketData', __typename: 'MarketData',

View File

@ -322,7 +322,7 @@ export const columns = (
{ {
value: ( value: (
<Tooltip <Tooltip
description={<FeesBreakdown feeFactors={market.fees?.factors} />} description={<FeesBreakdown feeFactors={market.fees.factors} />}
> >
<span className="border-b-2 border-dotted"> <span className="border-b-2 border-dotted">
{totalFees(market.fees.factors) ?? '-'} {totalFees(market.fees.factors) ?? '-'}