diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 900129b02..b9b2dad25 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,3 +42,5 @@ jobs: run: yarn nx affected:test - name: Build affected run: yarn nx affected:build + - name: Build affected spec + run: yarn nx affected --target=build-spec diff --git a/apps/console-lite/project.json b/apps/console-lite/project.json index 1b4fe5ab1..ca3f8a3b4 100644 --- a/apps/console-lite/project.json +++ b/apps/console-lite/project.json @@ -77,6 +77,13 @@ "nx build console-lite" ] } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/console-lite/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/console-lite/src/app/components/deal-ticket/deal-ticket-balance.spec.tsx b/apps/console-lite/src/app/components/deal-ticket/deal-ticket-balance.spec.tsx index b751b2829..7fdcfdba2 100644 --- a/apps/console-lite/src/app/components/deal-ticket/deal-ticket-balance.spec.tsx +++ b/apps/console-lite/src/app/components/deal-ticket/deal-ticket-balance.spec.tsx @@ -1,21 +1,22 @@ import React from 'react'; import { render } from '@testing-library/react'; import type { - PartyBalanceQuery_party_accounts, - PartyBalanceQuery_party_accounts_asset, -} from './__generated__/PartyBalanceQuery'; + AccountFragment, + DealTicketMarketFragment, +} from '@vegaprotocol/deal-ticket'; import { DealTicketBalance } from './deal-ticket-balance'; import { AccountType } from '@vegaprotocol/types'; -const tDAI: PartyBalanceQuery_party_accounts_asset = { - __typename: 'Asset', - id: '1', - symbol: 'tDAI', - name: 'TDAI', - decimals: 2, -}; +const tDAI: DealTicketMarketFragment['tradableInstrument']['instrument']['product']['settlementAsset'] = + { + __typename: 'Asset', + id: '1', + symbol: 'tDAI', + name: 'TDAI', + decimals: 2, + }; -const accounts: PartyBalanceQuery_party_accounts[] = [ +const accounts: AccountFragment[] = [ { __typename: 'Account', type: AccountType.ACCOUNT_TYPE_GENERAL, diff --git a/apps/console-lite/src/app/components/simple-market-list/simple-market-toolbar.spec.tsx b/apps/console-lite/src/app/components/simple-market-list/simple-market-toolbar.spec.tsx index f3a35acf5..2089918be 100644 --- a/apps/console-lite/src/app/components/simple-market-list/simple-market-toolbar.spec.tsx +++ b/apps/console-lite/src/app/components/simple-market-list/simple-market-toolbar.spec.tsx @@ -15,8 +15,8 @@ import { } from '@testing-library/react'; import { MockedProvider } from '@apollo/react-testing'; import { MarketState } from '@vegaprotocol/types'; +import type { Market } from '@vegaprotocol/market-list'; import SimpleMarketToolbar from './simple-market-toolbar'; -import type { SimpleMarkets_markets } from './__generated__/SimpleMarkets'; import { markets as filterData } from './mocks/market-filters.json'; const mockedNavigate = jest.fn(); @@ -35,35 +35,23 @@ describe('SimpleMarketToolbar', () => { const routes = useRoutes([ { path: '/', - element: ( - - ), + element: , }, { path: 'markets', children: [ { path: `:state`, - element: ( - - ), + element: , children: [ { path: `:product`, - element: ( - - ), + element: , children: [ { path: `:asset`, element: ( - + ), }, ], @@ -71,9 +59,7 @@ describe('SimpleMarketToolbar', () => { ], }, ], - element: ( - - ), + element: , }, ]); const location = useLocation(); @@ -166,7 +152,7 @@ describe('SimpleMarketToolbar', () => { })); render( - + , { wrapper: BrowserRouter } ); @@ -187,7 +173,7 @@ describe('SimpleMarketToolbar', () => { (useParams as jest.Mock).mockImplementation(() => ({})); render( - + , { wrapper: BrowserRouter } ); @@ -211,7 +197,7 @@ describe('SimpleMarketToolbar', () => { })); render( - + , { wrapper: BrowserRouter } ); diff --git a/apps/console-lite/tsconfig.spec.json b/apps/console-lite/tsconfig.spec.json index 32b355860..17b59f94d 100644 --- a/apps/console-lite/tsconfig.spec.json +++ b/apps/console-lite/tsconfig.spec.json @@ -3,11 +3,9 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "module": "commonjs", - "types": ["jest", "node", "@testing-library/jest-dom"], - "jsx": "react", - "allowSyntheticDefaultImports": true, - "esModuleInterop": true + "types": ["jest", "node", "@testing-library/jest-dom"] }, + "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts"], "include": [ "**/*.test.ts", "**/*.spec.ts", diff --git a/apps/explorer/project.json b/apps/explorer/project.json index 6d0e239a7..9bd14a156 100644 --- a/apps/explorer/project.json +++ b/apps/explorer/project.json @@ -74,6 +74,13 @@ "nx build explorer" ] } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/explorer/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/liquidity-provision-dashboard/project.json b/apps/liquidity-provision-dashboard/project.json index 44bd96f18..cd00ba0e1 100644 --- a/apps/liquidity-provision-dashboard/project.json +++ b/apps/liquidity-provision-dashboard/project.json @@ -88,6 +88,13 @@ "nx build liquidity-provision-dashboard" ] } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/liquidity-provision-dashboard/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/multisig-signer/project.json b/apps/multisig-signer/project.json index d149d922e..51a93ba88 100644 --- a/apps/multisig-signer/project.json +++ b/apps/multisig-signer/project.json @@ -74,6 +74,13 @@ "nx build multisig-signer" ] } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/multisig-signer/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/stats/project.json b/apps/stats/project.json index b2cd4ef89..a91297962 100644 --- a/apps/stats/project.json +++ b/apps/stats/project.json @@ -64,6 +64,13 @@ "jestConfig": "apps/stats/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/stats/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/token/project.json b/apps/token/project.json index 134893657..35013c747 100644 --- a/apps/token/project.json +++ b/apps/token/project.json @@ -74,6 +74,13 @@ "nx build token" ] } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/token/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/token/src/routes/governance/components/proposal/proposal.spec.tsx b/apps/token/src/routes/governance/components/proposal/proposal.spec.tsx index b8880e72c..38fd59bc6 100644 --- a/apps/token/src/routes/governance/components/proposal/proposal.spec.tsx +++ b/apps/token/src/routes/governance/components/proposal/proposal.spec.tsx @@ -1,6 +1,7 @@ import { render, screen } from '@testing-library/react'; import { generateProposal } from '../../test-helpers/generate-proposals'; import { Proposal } from './proposal'; +import type { Proposal_proposal } from '../../proposal/__generated__/Proposal'; jest.mock('../proposal-detail-header/proposal-header', () => ({ ProposalHeader: () =>
, @@ -20,13 +21,13 @@ jest.mock('../vote-details', () => ({ it('Renders with data-testid', () => { const proposal = generateProposal(); - render(); + render(); expect(screen.getByTestId('proposal')).toBeInTheDocument(); }); it('renders each section', () => { const proposal = generateProposal(); - render(); + render(); expect(screen.getByTestId('proposal-header')).toBeInTheDocument(); expect(screen.getByTestId('proposal-change-table')).toBeInTheDocument(); expect(screen.getByTestId('proposal-terms-json')).toBeInTheDocument(); diff --git a/apps/token/src/routes/governance/components/proposals-list/proposals-list.spec.tsx b/apps/token/src/routes/governance/components/proposals-list/proposals-list.spec.tsx index ab1bd7159..58f47d418 100644 --- a/apps/token/src/routes/governance/components/proposals-list/proposals-list.spec.tsx +++ b/apps/token/src/routes/governance/components/proposals-list/proposals-list.spec.tsx @@ -14,7 +14,7 @@ import { lastMonth, nextMonth, } from '../../test-helpers/mocks'; -import type { ProposalsConnection_proposalsConnection_edges_node as ProposalNode } from '@vegaprotocol/governance'; +import type { ProposalFields } from '../../__generated__/ProposalFields'; const openProposalClosesNextMonth = generateProposal({ id: 'proposal1', @@ -58,7 +58,7 @@ const failedProposalClosedLastMonth = generateProposal({ }, }); -const renderComponent = (proposals: ProposalNode[]) => ( +const renderComponent = (proposals: ProposalFields[]) => ( diff --git a/apps/token/src/routes/governance/components/proposals-list/rejected-proposals-list.spec.tsx b/apps/token/src/routes/governance/components/proposals-list/rejected-proposals-list.spec.tsx index 8c1826926..6804d1e94 100644 --- a/apps/token/src/routes/governance/components/proposals-list/rejected-proposals-list.spec.tsx +++ b/apps/token/src/routes/governance/components/proposals-list/rejected-proposals-list.spec.tsx @@ -12,7 +12,7 @@ import { nextWeek, lastMonth, } from '../../test-helpers/mocks'; -import type { ProposalsConnection_proposalsConnection_edges_node as ProposalNode } from '@vegaprotocol/governance'; +import type { ProposalFields } from '../../__generated__/ProposalFields'; const rejectedProposalClosesNextWeek = generateProposal({ id: 'rejected1', @@ -35,7 +35,7 @@ const rejectedProposalClosedLastMonth = generateProposal({ }, }); -const renderComponent = (proposals: ProposalNode[]) => ( +const renderComponent = (proposals: ProposalFields[]) => ( diff --git a/apps/token/src/routes/governance/proposal/proposal-container.spec.tsx b/apps/token/src/routes/governance/proposal/proposal-container.spec.tsx index a09ef5e03..83fa44f66 100644 --- a/apps/token/src/routes/governance/proposal/proposal-container.spec.tsx +++ b/apps/token/src/routes/governance/proposal/proposal-container.spec.tsx @@ -50,7 +50,7 @@ describe('Proposal container', () => { it('Renders proposal details if proposal is found', async () => { const proposal = generateProposal({ id: 'foo' }); - render(renderComponent(proposal, 'foo')); + render(renderComponent(proposal as Proposal_proposal, 'foo')); await waitFor(() => { expect(screen.getByTestId('proposal')).toBeInTheDocument(); }); diff --git a/apps/trading/project.json b/apps/trading/project.json index 4c32f33a9..d4005c7b4 100644 --- a/apps/trading/project.json +++ b/apps/trading/project.json @@ -60,6 +60,13 @@ "nx build trading" ] } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./apps/trading/tsconfig.spec.json" + } } }, "tags": [] diff --git a/apps/trading/tsconfig.spec.json b/apps/trading/tsconfig.spec.json index 8c8d4a70d..70edbccf0 100644 --- a/apps/trading/tsconfig.spec.json +++ b/apps/trading/tsconfig.spec.json @@ -1,10 +1,10 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "jsx": "react-jsx", "outDir": "../../dist/out-tsc", "module": "commonjs", - "types": ["jest", "node", "@testing-library/jest-dom"], - "jsx": "react" + "types": ["jest", "node", "@testing-library/jest-dom"] }, "include": [ "**/*.test.ts", diff --git a/libs/accounts/project.json b/libs/accounts/project.json index 67e4fbe40..6c3cb8730 100644 --- a/libs/accounts/project.json +++ b/libs/accounts/project.json @@ -69,6 +69,13 @@ "quiet": true } } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/accounts/tsconfig.spec.json" + } } } } diff --git a/libs/assets/project.json b/libs/assets/project.json index 6d659728b..033bfa958 100644 --- a/libs/assets/project.json +++ b/libs/assets/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/assets/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/assets/tsconfig.spec.json" + } } } } diff --git a/libs/candles-chart/project.json b/libs/candles-chart/project.json index b8f78f06d..1b35ba53a 100644 --- a/libs/candles-chart/project.json +++ b/libs/candles-chart/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/candles-chart/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/candles-chart/tsconfig.spec.json" + } } } } diff --git a/libs/cypress/project.json b/libs/cypress/project.json index f93119c56..a02c0f5ff 100644 --- a/libs/cypress/project.json +++ b/libs/cypress/project.json @@ -17,6 +17,13 @@ "jestConfig": "libs/cypress/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/cypress/tsconfig.spec.json" + } } }, "tags": [] diff --git a/libs/deal-ticket/project.json b/libs/deal-ticket/project.json index 52fb9137f..f9be92714 100644 --- a/libs/deal-ticket/project.json +++ b/libs/deal-ticket/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/deal-ticket/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/deal-ticket/tsconfig.spec.json" + } } } } diff --git a/libs/deal-ticket/src/components/deal-ticket-validation/use-order-validation.spec.tsx b/libs/deal-ticket/src/components/deal-ticket-validation/use-order-validation.spec.tsx index 775daee7d..088774b2a 100644 --- a/libs/deal-ticket/src/components/deal-ticket-validation/use-order-validation.spec.tsx +++ b/libs/deal-ticket/src/components/deal-ticket-validation/use-order-validation.spec.tsx @@ -48,6 +48,15 @@ const market: DealTicketMarketFragment = { price: '100', }, }, + fees: { + __typename: 'Fees', + factors: { + __typename: 'FeeFactors', + makerFee: '1', + infrastructureFee: '2', + liquidityFee: '3', + }, + }, }; const defaultWalletContext = { diff --git a/libs/deal-ticket/tsconfig.spec.json b/libs/deal-ticket/tsconfig.spec.json index 3da863401..17b59f94d 100644 --- a/libs/deal-ticket/tsconfig.spec.json +++ b/libs/deal-ticket/tsconfig.spec.json @@ -5,6 +5,7 @@ "module": "commonjs", "types": ["jest", "node", "@testing-library/jest-dom"] }, + "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts"], "include": [ "**/*.test.ts", "**/*.spec.ts", diff --git a/libs/deposits/project.json b/libs/deposits/project.json index e7cd58214..e6ee8e7e1 100644 --- a/libs/deposits/project.json +++ b/libs/deposits/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/deposits/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/deposits/tsconfig.spec.json" + } } } } diff --git a/libs/deposits/src/lib/deposit-form.spec.tsx b/libs/deposits/src/lib/deposit-form.spec.tsx index 29fa82f8e..b0ad442e0 100644 --- a/libs/deposits/src/lib/deposit-form.spec.tsx +++ b/libs/deposits/src/lib/deposit-form.spec.tsx @@ -2,28 +2,37 @@ import { waitFor, fireEvent, render, screen } from '@testing-library/react'; import BigNumber from 'bignumber.js'; import type { DepositFormProps } from './deposit-form'; import { DepositForm } from './deposit-form'; +import { AssetStatus } from '@vegaprotocol/types'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { useWeb3React } from '@web3-react/core'; -import type { Asset } from '@vegaprotocol/react-helpers'; +import type { AssetFieldsFragment } from '@vegaprotocol/assets'; jest.mock('@vegaprotocol/wallet'); jest.mock('@web3-react/core'); -function generateAsset(): Asset { +function generateAsset(): AssetFieldsFragment { return { __typename: 'Asset', id: 'asset-id', symbol: 'asset-symbol', name: 'asset-name', decimals: 2, + quantum: '', + status: AssetStatus.STATUS_ENABLED, source: { __typename: 'ERC20', contractAddress: 'contract-address', + lifetimeLimit: '', + withdrawThreshold: '', + }, + infrastructureFeeAccount: { + balance: '1', + __typename: 'Account', }, }; } -let asset: Asset; +let asset: AssetFieldsFragment; let props: DepositFormProps; const MOCK_ETH_ADDRESS = '0x72c22822A19D20DE7e426fB84aa047399Ddd8853'; diff --git a/libs/environment/project.json b/libs/environment/project.json index 7afafdeed..cad579d29 100644 --- a/libs/environment/project.json +++ b/libs/environment/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/environment/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/environment/tsconfig.spec.json" + } } } } diff --git a/libs/environment/src/components/network-switcher/network-switcher.spec.tsx b/libs/environment/src/components/network-switcher/network-switcher.spec.tsx index b3cd01806..306e3f47d 100644 --- a/libs/environment/src/components/network-switcher/network-switcher.spec.tsx +++ b/libs/environment/src/components/network-switcher/network-switcher.spec.tsx @@ -138,6 +138,8 @@ describe('Network switcher', () => { [Networks.TESTNET]: 'https://test.net', [Networks.STAGNET3]: 'https://stag3.net', [Networks.DEVNET]: 'https://dev.net', + [Networks.STAGNET1]: 'https://stag1.net', + [Networks.SANDBOX]: 'https://sandbox.net', }; // @ts-ignore Typescript doesn't know about this module being mocked useEnvironment.mockImplementation(() => ({ @@ -175,6 +177,8 @@ describe('Network switcher', () => { [Networks.TESTNET]: 'https://test.net', [Networks.STAGNET3]: 'https://stag3.net', [Networks.DEVNET]: 'https://dev.net', + [Networks.STAGNET1]: 'https://stag1.net', + [Networks.SANDBOX]: 'https://sandbox.net', }; // @ts-ignore Typescript doesn't know about this module being mocked useEnvironment.mockImplementation(() => ({ @@ -205,6 +209,8 @@ describe('Network switcher', () => { [Networks.TESTNET]: 'https://test.net', [Networks.STAGNET3]: 'https://stag3.net', [Networks.DEVNET]: 'https://dev.net', + [Networks.STAGNET1]: 'https://stag1.net', + [Networks.SANDBOX]: 'https://sandbox.net', }; // @ts-ignore Typescript doesn't know about this module being mocked useEnvironment.mockImplementation(() => ({ diff --git a/libs/fills/project.json b/libs/fills/project.json index c3160d23b..3d629c5cc 100644 --- a/libs/fills/project.json +++ b/libs/fills/project.json @@ -69,6 +69,13 @@ "quiet": true } } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/fills/tsconfig.spec.json" + } } } } diff --git a/libs/governance/project.json b/libs/governance/project.json index bd602dfbc..a403bc8d4 100644 --- a/libs/governance/project.json +++ b/libs/governance/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/governance/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/governance/tsconfig.spec.json" + } } } } diff --git a/libs/liquidity/project.json b/libs/liquidity/project.json index f1b81c3c4..dd2ec595f 100644 --- a/libs/liquidity/project.json +++ b/libs/liquidity/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/liquidity/jest.config.js", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/liquidity/tsconfig.spec.json" + } } } } diff --git a/libs/market-depth/project.json b/libs/market-depth/project.json index adb468ce6..e7aa615ab 100644 --- a/libs/market-depth/project.json +++ b/libs/market-depth/project.json @@ -69,6 +69,13 @@ "quiet": true } } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/market-depth/tsconfig.spec.json" + } } } } diff --git a/libs/market-depth/src/lib/orderbook.spec.tsx b/libs/market-depth/src/lib/orderbook.spec.tsx index 8f4e45a6a..f047a4ce0 100644 --- a/libs/market-depth/src/lib/orderbook.spec.tsx +++ b/libs/market-depth/src/lib/orderbook.spec.tsx @@ -6,6 +6,7 @@ describe('Orderbook', () => { const params = { numberOfSellRows: 100, numberOfBuyRows: 100, + step: 1, midPrice: 122900, bestStaticBidPrice: 122905, bestStaticOfferPrice: 122895, diff --git a/libs/market-depth/src/lib/orderbook.stories.tsx b/libs/market-depth/src/lib/orderbook.stories.tsx index a7736b0fa..c3340ddb8 100644 --- a/libs/market-depth/src/lib/orderbook.stories.tsx +++ b/libs/market-depth/src/lib/orderbook.stories.tsx @@ -40,7 +40,6 @@ export const Continuous = Template.bind({}); Continuous.args = { numberOfSellRows: 100, numberOfBuyRows: 100, - midPrice: 1000, bestStaticBidPrice: 1000, bestStaticOfferPrice: 1000, decimalPlaces: 3, @@ -51,7 +50,6 @@ export const Auction = Template.bind({}); Auction.args = { numberOfSellRows: 100, numberOfBuyRows: 100, - midPrice: 122900, bestStaticBidPrice: 122905, bestStaticOfferPrice: 122895, decimalPlaces: 3, @@ -64,7 +62,6 @@ export const Empty = Template.bind({}); Empty.args = { numberOfSellRows: 0, numberOfBuyRows: 0, - midPrice: 0, bestStaticBidPrice: 0, bestStaticOfferPrice: 0, decimalPlaces: 3, diff --git a/libs/market-depth/tsconfig.spec.json b/libs/market-depth/tsconfig.spec.json index 3da863401..17b59f94d 100644 --- a/libs/market-depth/tsconfig.spec.json +++ b/libs/market-depth/tsconfig.spec.json @@ -5,6 +5,7 @@ "module": "commonjs", "types": ["jest", "node", "@testing-library/jest-dom"] }, + "files": ["../../node_modules/@nrwl/react/typings/cssmodule.d.ts"], "include": [ "**/*.test.ts", "**/*.spec.ts", diff --git a/libs/market-info/project.json b/libs/market-info/project.json index 8a0195e6f..3da329dc4 100644 --- a/libs/market-info/project.json +++ b/libs/market-info/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/market-info/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/market-info/tsconfig.spec.json" + } } } } diff --git a/libs/market-list/project.json b/libs/market-list/project.json index 1e8233278..101d1bbdb 100644 --- a/libs/market-list/project.json +++ b/libs/market-list/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/market-list/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/market-list/tsconfig.spec.json" + } } } } diff --git a/libs/network-info/project.json b/libs/network-info/project.json index 25304d9b1..fa37e8432 100644 --- a/libs/network-info/project.json +++ b/libs/network-info/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/network-info/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/network-info/tsconfig.spec.json" + } } } } diff --git a/libs/network-stats/project.json b/libs/network-stats/project.json index 17c322c43..98d4ff003 100644 --- a/libs/network-stats/project.json +++ b/libs/network-stats/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/network-stats/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/network-stats/tsconfig.spec.json" + } } } } diff --git a/libs/orders/project.json b/libs/orders/project.json index 232d39caf..fd39d313d 100644 --- a/libs/orders/project.json +++ b/libs/orders/project.json @@ -69,6 +69,13 @@ "quiet": true } } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/orders/tsconfig.spec.json" + } } } } diff --git a/libs/orders/src/lib/order-hooks/use-order-edit.spec.tsx b/libs/orders/src/lib/order-hooks/use-order-edit.spec.tsx index 9148fea54..329a87492 100644 --- a/libs/orders/src/lib/order-hooks/use-order-edit.spec.tsx +++ b/libs/orders/src/lib/order-hooks/use-order-edit.spec.tsx @@ -7,7 +7,7 @@ import type { OrderEvent } from './'; import { ORDER_EVENT_SUB } from './order-event-query'; import type { MockedResponse } from '@apollo/client/testing'; import { MockedProvider } from '@apollo/client/testing'; -import type { OrderWithMarket } from '../components'; +import type { Order } from '../components'; import { generateOrder } from '../components'; import { OrderStatus, @@ -27,10 +27,7 @@ const defaultWalletContext = { connector: null, }; -function setup( - order: OrderWithMarket, - context?: Partial -) { +function setup(order: Order, context?: Partial) { const mocks: MockedResponse = { request: { query: ORDER_EVENT_SUB, diff --git a/libs/positions/project.json b/libs/positions/project.json index f9bb943cb..4c9c6f50e 100644 --- a/libs/positions/project.json +++ b/libs/positions/project.json @@ -69,6 +69,13 @@ "quiet": true } } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/positions/tsconfig.spec.json" + } } } } diff --git a/libs/positions/src/lib/close-position-dialog/requested.spec.tsx b/libs/positions/src/lib/close-position-dialog/requested.spec.tsx index edfc89491..f9b10cd65 100644 --- a/libs/positions/src/lib/close-position-dialog/requested.spec.tsx +++ b/libs/positions/src/lib/close-position-dialog/requested.spec.tsx @@ -22,6 +22,7 @@ describe('Close position dialog - Request', () => { market: null, marketData: null, orders: [], + loading: false, }); render(); expect(screen.getByText('Loading...')).toBeInTheDocument(); diff --git a/libs/positions/src/lib/positions-table.stories.tsx b/libs/positions/src/lib/positions-table.stories.tsx index 65a4cce55..8df777804 100644 --- a/libs/positions/src/lib/positions-table.stories.tsx +++ b/libs/positions/src/lib/positions-table.stories.tsx @@ -1,3 +1,4 @@ +import BigNumber from 'bignumber.js'; import type { Story, Meta } from '@storybook/react'; import { PositionsTable } from './positions-table'; import type { Position } from './positions-data-providers'; @@ -28,7 +29,7 @@ const longPosition: Position = { // leverageSearch: '0', liquidationPrice: '1129935', lowMarginLevel: false, - // marginAccountBalance: '0', + marginAccountBalance: new BigNumber('0'), // marginMaintenance: '0', // marginSearch: '0', // marginInitial: '0', @@ -60,7 +61,7 @@ const shortPosition: Position = { // leverageSearch: '0', liquidationPrice: '23734', lowMarginLevel: false, - // marginAccountBalance: '0', + marginAccountBalance: new BigNumber('0'), // marginMaintenance: '0', // marginSearch: '0', // marginInitial: '0', diff --git a/libs/react-helpers/project.json b/libs/react-helpers/project.json index 4c69783a6..d8d9c3d6a 100644 --- a/libs/react-helpers/project.json +++ b/libs/react-helpers/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/react-helpers/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/react-helpers/tsconfig.spec.json" + } } } } diff --git a/libs/react-helpers/src/hooks/use-network-params.spec.tsx b/libs/react-helpers/src/hooks/use-network-params.spec.tsx index 4e2cf31a8..8fce6ebd4 100644 --- a/libs/react-helpers/src/hooks/use-network-params.spec.tsx +++ b/libs/react-helpers/src/hooks/use-network-params.spec.tsx @@ -10,7 +10,7 @@ import { useNetworkParams, } from './use-network-params'; import type { ReactNode } from 'react'; -import type { NetworkParams as NetworkParamsResponse } from './__generated__'; +import type { NetworkParams as NetworkParamsResponse } from './__generated__/NetworkParams'; describe('useNetworkParam', () => { const setup = (arg: NetworkParamsKey) => { diff --git a/libs/react-helpers/tsconfig.spec.json b/libs/react-helpers/tsconfig.spec.json index a85d573fc..3da863401 100644 --- a/libs/react-helpers/tsconfig.spec.json +++ b/libs/react-helpers/tsconfig.spec.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "../../dist/out-tsc", "module": "commonjs", - "types": ["jest", "node"] + "types": ["jest", "node", "@testing-library/jest-dom"] }, "include": [ "**/*.test.ts", diff --git a/libs/smart-contracts/project.json b/libs/smart-contracts/project.json index 9ef0555f2..3481a5610 100644 --- a/libs/smart-contracts/project.json +++ b/libs/smart-contracts/project.json @@ -26,6 +26,13 @@ "jestConfig": "libs/smart-contracts/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/smart-contracts/tsconfig.spec.json" + } } }, "tags": [] diff --git a/libs/trades/project.json b/libs/trades/project.json index 4e665116b..4a9e041fd 100644 --- a/libs/trades/project.json +++ b/libs/trades/project.json @@ -38,6 +38,13 @@ "jestConfig": "libs/trades/jest.config.ts", "passWithNoTests": true } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/trades/tsconfig.spec.json" + } } } } diff --git a/libs/trades/src/lib/trades-table.spec.tsx b/libs/trades/src/lib/trades-table.spec.tsx index f27f20593..849b52608 100644 --- a/libs/trades/src/lib/trades-table.spec.tsx +++ b/libs/trades/src/lib/trades-table.spec.tsx @@ -1,9 +1,9 @@ import { act, render, screen } from '@testing-library/react'; import { getDateTimeFormat } from '@vegaprotocol/react-helpers'; import { DOWN_CLASS, TradesTable, UP_CLASS } from './trades-table'; -import type { TradeFields } from './__generated__/TradeFields'; +import type { Trade } from './trades-data-provider'; -const trade: TradeFields = { +const trade: Trade = { __typename: 'Trade', id: 'trade-id', price: '111122200', @@ -14,7 +14,7 @@ const trade: TradeFields = { id: 'market-id', decimalPlaces: 2, positionDecimalPlaces: 2, - }, + } as Trade['market'], }; it('Correct columns are rendered', async () => { diff --git a/libs/ui-toolkit/project.json b/libs/ui-toolkit/project.json index e1771990d..4928f7987 100644 --- a/libs/ui-toolkit/project.json +++ b/libs/ui-toolkit/project.json @@ -69,6 +69,13 @@ "quiet": true } } + }, + "build-spec": { + "executor": "@nrwl/workspace:run-commands", + "outputs": [], + "options": { + "command": "yarn tsc --project ./libs/ui-toolkit/tsconfig.spec.json" + } } } } diff --git a/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.spec.tsx b/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.spec.tsx index 33c6f28a4..630441d21 100644 --- a/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.spec.tsx +++ b/libs/ui-toolkit/src/components/theme-switcher/theme-switcher.spec.tsx @@ -6,6 +6,7 @@ describe('ThemeSwitcher', () => { it('should render successfully', () => { const { baseElement } = render( { return; }} diff --git a/libs/ui-toolkit/src/components/vega-logo/vega-logo.tsx b/libs/ui-toolkit/src/components/vega-logo/vega-logo.tsx index 672105f54..991788d99 100644 --- a/libs/ui-toolkit/src/components/vega-logo/vega-logo.tsx +++ b/libs/ui-toolkit/src/components/vega-logo/vega-logo.tsx @@ -17,7 +17,7 @@ export const VegaLogo = () => { ); }; -export const VLogo = ({ className }: { className: string }) => { +export const VLogo = ({ className }: { className?: string }) => { return (