chore(trading,governance,explorer): nx migration to latest (#5246)

Co-authored-by: Edd <edd@vega.xyz>
This commit is contained in:
Matthew Russell 2023-11-14 06:25:29 -08:00 committed by GitHub
parent 132f2e4b2b
commit b3014bb98a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
128 changed files with 6891 additions and 9956 deletions

View File

@ -34,7 +34,7 @@ jobs:
${{ runner.os }}-cache-node-modules- ${{ runner.os }}-cache-node-modules-
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
@ -57,7 +57,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
@ -96,7 +96,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: yarn cache: yarn
@ -128,7 +128,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
cache: yarn cache: yarn
@ -182,7 +182,7 @@ jobs:
run: | run: |
if [[ "${{ github.base_ref }}" == "develop" ]]; then if [[ "${{ github.base_ref }}" == "develop" ]]; then
echo "e2e-needed=true" >> $GITHUB_OUTPUT echo "e2e-needed=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.base_ref }}" == "main" ]]; then elif [[ "${{ github.base_ref }}" == "main" ]]; then
echo "e2e-needed=true" >> $GITHUB_OUTPUT echo "e2e-needed=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == *"release/"* ]]; then elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == *"release/"* ]]; then
echo "e2e-needed=true" >> $GITHUB_OUTPUT echo "e2e-needed=true" >> $GITHUB_OUTPUT

View File

@ -32,9 +32,9 @@ jobs:
# cache node modules # cache node modules
#---------------------------------------------- #----------------------------------------------
- name: setup node - name: setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: '16' node-version-file: '.nvmrc'
cache: yarn cache: yarn
- name: Cache node modules - name: Cache node modules

View File

@ -18,11 +18,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Use Node.js 16 - name: Use Node.js 20
id: Node id: Node
uses: actions/setup-node@v2 uses: actions/setup-node@v4
with: with:
node-version: 16.15.1 node-version-file: '.nvmrc'
- name: Run Cypress tests - name: Run Cypress tests
uses: cypress-io/github-action@v4 uses: cypress-io/github-action@v4

View File

@ -57,6 +57,14 @@ jobs:
path: './frontend-monorepo' path: './frontend-monorepo'
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: './frontend-monorepo/.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
cache: yarn
cache-dependency-path: './frontend-monorepo/yarn.lock'
# Restore node_modules from cache if possible # Restore node_modules from cache if possible
- name: Restore node_modules from cache - name: Restore node_modules from cache
id: cache-node-modules id: cache-node-modules

View File

@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions

View File

@ -18,13 +18,13 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version: 16 node-version-file: '.nvmrc'
- name: Install dependencies - name: Install dependencies
run: | run: |
rm package.json rm package.json
npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx
- name: Check PR title - name: Check PR title

View File

@ -93,7 +93,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions

View File

@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Setup node - name: Setup node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions

2
.gitignore vendored
View File

@ -52,3 +52,5 @@ cypress.env.json
/apps/**/cypress/reports/ /apps/**/cypress/reports/
/apps/**/cypress/downloads/ /apps/**/cypress/downloads/
/apps/**/fixtures/wallet/node** /apps/**/fixtures/wallet/node**
.nx/cache

2
.nvmrc
View File

@ -1 +1 @@
16.20.2 20.9.0

View File

@ -8,3 +8,5 @@ __generated___
apps/static/src/assets/devnet-tranches.json apps/static/src/assets/devnet-tranches.json
apps/static/src/assets/mainnet-tranches.json apps/static/src/assets/mainnet-tranches.json
apps/static/src/assets/testnet-tranches.json apps/static/src/assets/testnet-tranches.json
/.nx/cache

View File

@ -1,3 +1,4 @@
{ {
"plugins": ["prettier-plugin-tailwindcss"],
"singleQuote": true "singleQuote": true
} }

View File

@ -136,7 +136,7 @@ The [`docker`](./docker) subfolder has some docker configurations for easily set
Using multistage dockerfile dist is compiled using [node](https://hub.docker.com/_/node) image and later packed to nginx as in [dist build](#dist-build). The multistage builds ensures consistent CPU architecture and build toolchains are used so that the result will be identical. Using multistage dockerfile dist is compiled using [node](https://hub.docker.com/_/node) image and later packed to nginx as in [dist build](#dist-build). The multistage builds ensures consistent CPU architecture and build toolchains are used so that the result will be identical.
```bash ```bash
docker build --build-arg APP=[YOUR APP] --build-arg NODE_VERSION=16.5.1 --build-arg ENV_NAME=mainnet -t [TAG] -f docker/node-inside-docker.Dockerfile . docker build --build-arg APP=[YOUR APP] --build-arg NODE_VERSION=20.9.1 --build-arg ENV_NAME=mainnet -t [TAG] -f docker/node-inside-docker.Dockerfile .
``` ```
### Computing ipfs-hash of the build ### Computing ipfs-hash of the build

View File

@ -4,7 +4,9 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {} "rules": {
"cypress/unsafe-to-chain-command": 0
}
} }
] ]
} }

View File

@ -17,7 +17,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"]

View File

@ -53,7 +53,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/explorer/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["apps/explorer/**/*.{ts,tsx,js,jsx}"]
@ -63,14 +63,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/explorer"], "outputs": ["{workspaceRoot}/coverage/apps/explorer"],
"options": { "options": {
"jestConfig": "apps/explorer/jest.config.ts", "jestConfig": "apps/explorer/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"generate-types": { "generate-types": {

View File

@ -91,6 +91,6 @@ describe('Market link component', () => {
}; };
const res = render(renderComponent('123', [mock])); const res = render(renderComponent('123', [mock]));
expect(await res.findByText('123')).toBeInTheDocument(); expect(await res.findByTitle('123')).toBeInTheDocument();
}); });
}); });

View File

@ -17,7 +17,7 @@ function renderAmendOrderDetails(
mocks: MockedResponse[] mocks: MockedResponse[]
) { ) {
return render( return render(
<MockedProvider mocks={mocks} addTypename={false}> <MockedProvider mocks={mocks}>
<MemoryRouter> <MemoryRouter>
<AmendOrderDetails version={version} id={id} amend={amend} /> <AmendOrderDetails version={version} id={id} amend={amend} />
</MemoryRouter> </MemoryRouter>
@ -44,18 +44,18 @@ function renderExistingAmend(
orderByID: { orderByID: {
__typename: 'Order', __typename: 'Order',
id: '123', id: '123',
type: 'GTT', type: Schema.OrderType.TYPE_LIMIT,
status: Schema.OrderStatus.STATUS_ACTIVE, status: Schema.OrderStatus.STATUS_ACTIVE,
version: version, version: version ? version.toString() : '',
createdAt: '123', createdAt: '123',
updatedAt: '456', updatedAt: '456',
expiresAt: '789', expiresAt: '789',
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC, timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
price: '200', price: '200',
side: 'BUY', side: Schema.Side.SIDE_BUY,
peggedOrder: null, peggedOrder: null,
remaining: '99', remaining: '99',
rejectionReason: 'rejection', rejectionReason: Schema.OrderRejectionReason.ORDER_ERROR_NOT_FOUND,
reference: '123', reference: '123',
size: '100', size: '100',
party: { party: {
@ -65,18 +65,15 @@ function renderExistingAmend(
market: { market: {
__typename: 'Market', __typename: 'Market',
id: '789', id: '789',
state: 'STATUS_ACTIVE', state: Schema.MarketState.STATE_ACTIVE,
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
decimalPlaces: '5', decimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
name: 'test', name: 'test',
product: { product: {
__typename: 'Future', __typename: 'Future',
quoteName: '123', quoteName: '123',
settlementAsset: {
decimals: 8,
},
}, },
}, },
}, },
@ -97,18 +94,18 @@ function renderExistingAmend(
orderByID: { orderByID: {
__typename: 'Order', __typename: 'Order',
id: '123', id: '123',
type: 'GTT', type: Schema.OrderType.TYPE_LIMIT,
status: Schema.OrderStatus.STATUS_ACTIVE, status: Schema.OrderStatus.STATUS_ACTIVE,
version: 100, version: '100',
createdAt: '123', createdAt: '123',
updatedAt: '456', updatedAt: '456',
expiresAt: '789', expiresAt: '789',
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC, timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
peggedOrder: null, peggedOrder: null,
price: '200', price: '200',
side: 'BUY', side: Schema.Side.SIDE_BUY,
remaining: '99', remaining: '99',
rejectionReason: 'rejection', rejectionReason: Schema.OrderRejectionReason.ORDER_ERROR_NOT_FOUND,
reference: '123', reference: '123',
size: '200', size: '200',
party: { party: {
@ -117,19 +114,16 @@ function renderExistingAmend(
}, },
market: { market: {
__typename: 'Market', __typename: 'Market',
id: 'amend-to-order-latest-version', id: '8888',
state: 'STATUS_ACTIVE', state: Schema.MarketState.STATE_ACTIVE,
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
decimalPlaces: '5', decimalPlaces: 0,
tradableInstrument: { tradableInstrument: {
instrument: { instrument: {
name: 'amend-to-order-latest-version-test', name: 'amend-to-order-latest-version-test',
product: { product: {
__typename: 'Future', __typename: 'Future',
quoteName: '123', quoteName: '123',
settlementAsset: {
decimals: 8,
},
}, },
}, },
}, },
@ -142,13 +136,13 @@ function renderExistingAmend(
request: { request: {
query: ExplorerMarketDocument, query: ExplorerMarketDocument,
variables: { variables: {
id: '789', id: '8888',
}, },
}, },
result: { result: {
data: { data: {
market: { market: {
id: '789', id: '8888',
decimalPlaces: 5, decimalPlaces: 5,
positionDecimalPlaces: 2, positionDecimalPlaces: 2,
state: 'irrelevant-test-data', state: 'irrelevant-test-data',
@ -225,12 +219,10 @@ describe('Amend order details', () => {
it('Fetches latest version when version is not specified', async () => { it('Fetches latest version when version is not specified', async () => {
const amend: Amend = { const amend: Amend = {
price: '-7879', price: '123',
}; };
const res = renderExistingAmend('123', undefined, amend); const res = renderExistingAmend('123', undefined, amend);
expect( expect(await res.findByText('test-label')).toBeInTheDocument();
await res.findByText('amend-to-order-latest-version')
).toBeInTheDocument();
}); });
}); });

View File

@ -46,10 +46,10 @@ const AmendOrderDetails = ({ id, version, amend }: AmendOrderDetailsProps) => {
<div className={wrapperClasses}> <div className={wrapperClasses}>
<div className="mb-12 lg:mb-0"> <div className="mb-12 lg:mb-0">
<div className="relative block rounded-lg px-3 py-6 md:px-6 lg:-mr-7"> <div className="relative block rounded-lg px-3 py-6 md:px-6 lg:-mr-7">
<h2 className="text-3xl font-bold mb-4 display-5"> <h2 className="display-5 mb-4 text-3xl font-bold">
{t('Order not found')} {t('Order not found')}
</h2> </h2>
<p className="text-gray-500 mb-12"> <p className="mb-12 text-gray-500">
{t('No order created from this transaction')} {t('No order created from this transaction')}
</p> </p>
</div> </div>
@ -68,24 +68,24 @@ const AmendOrderDetails = ({ id, version, amend }: AmendOrderDetailsProps) => {
<div className={wrapperClasses}> <div className={wrapperClasses}>
<div className="mb-12 lg:mb-0"> <div className="mb-12 lg:mb-0">
<div className="relative block px-3 py-6 md:px-6 lg:-mr-7"> <div className="relative block px-3 py-6 md:px-6 lg:-mr-7">
<h2 className="text-3xl font-bold mb-4 display-5"> <h2 className="display-5 mb-4 text-3xl font-bold">
{t('Edits to ')} {t('Edits to ')}
{sideText[o.side]} {sideText[o.side]}
{t(' order')} {t(' order')}
</h2> </h2>
<p className="text-gray-500 mb-4"> <div className="mb-4 text-gray-500">
In <MarketLink id={o.market.id} />, updated at{' '} In <MarketLink id={o.market.id} />, updated at{' '}
<Time date={o.updatedAt} />. <Time date={o.updatedAt} />.
</p> </div>
<div className="grid md:grid-cols-4 gap-x-6"> <div className="grid gap-x-6 md:grid-cols-4">
{amend.sizeDelta && amend.sizeDelta !== '0' ? ( {amend.sizeDelta && amend.sizeDelta !== '0' ? (
<div className="mb-12 md:mb-0"> <div className="mb-12 md:mb-0">
<h2 className="text-2xl font-bold text-dark mb-4"> <h2 className="text-dark mb-4 text-2xl font-bold">
{t('New size')} {t('New size')}
</h2> </h2>
<h5 <h5
className={`text-lg font-medium text-gray-500 mb-0 capitalize ${getSideDeltaColour( className={`mb-0 text-lg font-medium capitalize text-gray-500 ${getSideDeltaColour(
amend.sizeDelta amend.sizeDelta
)}`} )}`}
> >
@ -96,10 +96,10 @@ const AmendOrderDetails = ({ id, version, amend }: AmendOrderDetailsProps) => {
{amend.price && amend.price !== '0' ? ( {amend.price && amend.price !== '0' ? (
<div className=""> <div className="">
<h2 className="text-2xl font-bold text-dark mb-4"> <h2 className="text-dark mb-4 text-2xl font-bold">
{t('New price')} {t('New price')}
</h2> </h2>
<h5 className="text-lg font-medium text-gray-500 mb-0"> <h5 className="mb-0 text-lg font-medium text-gray-500">
<PriceInMarket price={amend.price} marketId={o.market.id} /> <PriceInMarket price={amend.price} marketId={o.market.id} />
</h5> </h5>
</div> </div>
@ -108,10 +108,10 @@ const AmendOrderDetails = ({ id, version, amend }: AmendOrderDetailsProps) => {
{amend.peggedReference && {amend.peggedReference &&
amend.peggedReference !== 'PEGGED_REFERENCE_UNSPECIFIED' ? ( amend.peggedReference !== 'PEGGED_REFERENCE_UNSPECIFIED' ? (
<div className=""> <div className="">
<h2 className="text-2xl font-bold text-dark mb-4"> <h2 className="text-dark mb-4 text-2xl font-bold">
{t('New reference')} {t('New reference')}
</h2> </h2>
<h5 className="text-lg font-medium text-gray-500 mb-0"> <h5 className="mb-0 text-lg font-medium text-gray-500">
{peggedReference[amend.peggedReference]} {peggedReference[amend.peggedReference]}
</h5> </h5>
</div> </div>
@ -119,10 +119,10 @@ const AmendOrderDetails = ({ id, version, amend }: AmendOrderDetailsProps) => {
{amend.peggedOffset ? ( {amend.peggedOffset ? (
<div className=""> <div className="">
<h2 className="text-2xl font-bold text-dark mb-4"> <h2 className="text-dark mb-4 text-2xl font-bold">
{t('New offset')} {t('New offset')}
</h2> </h2>
<h5 className="text-lg font-medium text-gray-500 mb-0"> <h5 className="mb-0 text-lg font-medium text-gray-500">
{amend.peggedOffset} {amend.peggedOffset}
</h5> </h5>
</div> </div>

View File

@ -2,7 +2,11 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"types": ["node"] "types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"files": [ "files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/cssmodule.d.ts",

View File

@ -3,7 +3,13 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"module": "commonjs", "module": "commonjs",
"types": ["jest", "node", "@testing-library/jest-dom"] "types": [
"jest",
"node",
"@testing-library/jest-dom",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"include": [ "include": [
"**/*.test.ts", "**/*.test.ts",

View File

@ -4,7 +4,9 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {} "rules": {
"cypress/unsafe-to-chain-command": 0
}
} }
] ]
} }

View File

@ -17,7 +17,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/governance-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/governance-e2e/**/*.{js,ts}"]

View File

@ -61,6 +61,7 @@ const marketProposalType = 'proposal-type';
describe( describe(
'Governance flow for proposal details', 'Governance flow for proposal details',
{ tags: '@slow' }, { tags: '@slow' },
// @ts-ignore clash between jest and cypress
function () { function () {
before('connect wallets and set approval limit', function () { before('connect wallets and set approval limit', function () {
cy.visit('/'); cy.visit('/');
@ -78,6 +79,7 @@ describe(
getProposalInformationFromTable('ID').invoke('text').as('parentMarketId'); getProposalInformationFromTable('ID').invoke('text').as('parentMarketId');
}); });
// @ts-ignore clash between jest and cypress
beforeEach('visit proposals tab', function () { beforeEach('visit proposals tab', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();
@ -323,6 +325,7 @@ describe(
}); });
}); });
cy.VegaWalletSubmitProposal( cy.VegaWalletSubmitProposal(
// @ts-ignore this is any
createSuccessorMarketProposalTxBody(this.parentMarketId) createSuccessorMarketProposalTxBody(this.parentMarketId)
); );
navigateTo(navigation.proposals); navigateTo(navigation.proposals);
@ -334,6 +337,7 @@ describe(
cy.getByTestId(proposalTermsToggle).click(); cy.getByTestId(proposalTermsToggle).click();
cy.get('.language-json').within(() => { cy.get('.language-json').within(() => {
cy.get('.hljs-attr').should('contain.text', 'parentMarketId'); cy.get('.hljs-attr').should('contain.text', 'parentMarketId');
// @ts-ignore this is any
cy.get('.hljs-string').should('contain.text', this.parentMarketId); cy.get('.hljs-string').should('contain.text', this.parentMarketId);
cy.get('.hljs-attr').should('contain.text', 'insurancePoolFraction'); cy.get('.hljs-attr').should('contain.text', 'insurancePoolFraction');
cy.get('.hljs-string').should('contain.text', '0.75'); cy.get('.hljs-string').should('contain.text', '0.75');
@ -352,6 +356,7 @@ describe(
validateProposalDetailsDiff( validateProposalDetailsDiff(
'Parent Market ID', 'Parent Market ID',
proposalChangeType.ADDED, proposalChangeType.ADDED,
// @ts-ignore this is any
this.parentMarketId this.parentMarketId
); );
validateProposalDetailsDiff( validateProposalDetailsDiff(
@ -450,6 +455,7 @@ describe(
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2); const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
submitUniqueRawProposal({ submitUniqueRawProposal({
proposalBody: proposalPath, proposalBody: proposalPath,
// @ts-ignore this is any
updateMarketId: this.parentMarketId, updateMarketId: this.parentMarketId,
enactmentTimestamp: enactmentTimestamp, enactmentTimestamp: enactmentTimestamp,
closingTimestamp: closingTimestamp, closingTimestamp: closingTimestamp,
@ -466,6 +472,7 @@ describe(
cy.getByTestId('proposal-update-market-state').within(() => { cy.getByTestId('proposal-update-market-state').within(() => {
getProposalInformationFromTable('Market ID') getProposalInformationFromTable('Market ID')
.invoke('text') .invoke('text')
// @ts-ignore this is any
.and('eq', this.parentMarketId); .and('eq', this.parentMarketId);
}); });
}); });
@ -476,6 +483,7 @@ describe(
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2); const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
submitUniqueRawProposal({ submitUniqueRawProposal({
proposalBody: proposalPath, proposalBody: proposalPath,
// @ts-ignore this is any
updateMarketId: this.parentMarketId, updateMarketId: this.parentMarketId,
enactmentTimestamp: enactmentTimestamp, enactmentTimestamp: enactmentTimestamp,
closingTimestamp: closingTimestamp, closingTimestamp: closingTimestamp,
@ -489,6 +497,7 @@ describe(
cy.getByTestId('proposal-update-market-state').within(() => { cy.getByTestId('proposal-update-market-state').within(() => {
getProposalInformationFromTable('Market ID') getProposalInformationFromTable('Market ID')
.invoke('text') .invoke('text')
// @ts-ignore this is any
.and('eq', this.parentMarketId); .and('eq', this.parentMarketId);
}); });
}); });
@ -499,6 +508,7 @@ describe(
const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2); const closingTimestamp = createTenDigitUnixTimeStampForSpecifiedDays(2);
submitUniqueRawProposal({ submitUniqueRawProposal({
proposalBody: proposalPath, proposalBody: proposalPath,
// @ts-ignore this is any
updateMarketId: this.parentMarketId, updateMarketId: this.parentMarketId,
enactmentTimestamp: enactmentTimestamp, enactmentTimestamp: enactmentTimestamp,
closingTimestamp: closingTimestamp, closingTimestamp: closingTimestamp,
@ -518,6 +528,7 @@ describe(
cy.getByTestId('proposal-update-market-state').within(() => { cy.getByTestId('proposal-update-market-state').within(() => {
getProposalInformationFromTable('Market ID') getProposalInformationFromTable('Market ID')
.invoke('text') .invoke('text')
// @ts-ignore this is any
.and('eq', this.parentMarketId); .and('eq', this.parentMarketId);
getProposalDetailsValue('Termination Price').should( getProposalDetailsValue('Termination Price').should(
'contain.text', 'contain.text',

View File

@ -37,6 +37,7 @@ context(
vegaWalletSetSpecifiedApprovalAmount('1000'); vegaWalletSetSpecifiedApprovalAmount('1000');
}); });
// @ts-ignore clash between jest and cypress
beforeEach('visit proposals', function () { beforeEach('visit proposals', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();

View File

@ -78,6 +78,7 @@ context(
vegaWalletSetSpecifiedApprovalAmount('1000'); vegaWalletSetSpecifiedApprovalAmount('1000');
}); });
// @ts-ignore clash between jest and cypress
beforeEach('visit governance tab', function () { beforeEach('visit governance tab', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();
@ -301,6 +302,7 @@ context(
cy.getByTestId(voteButtons).should('not.exist'); cy.getByTestId(voteButtons).should('not.exist');
cy.getByTestId('min-proposal-requirements').should( cy.getByTestId('min-proposal-requirements').should(
'have.text', 'have.text',
// @ts-ignore this is any
`You must have at least ${this.minVoterBalance} VEGA associated to vote on this proposal` `You must have at least ${this.minVoterBalance} VEGA associated to vote on this proposal`
); );
}); });

View File

@ -70,6 +70,7 @@ context(
vegaWalletSetSpecifiedApprovalAmount('1000'); vegaWalletSetSpecifiedApprovalAmount('1000');
}); });
// @ts-ignore clash between jest and cypress
beforeEach('visit governance tab', function () { beforeEach('visit governance tab', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();
@ -216,6 +217,7 @@ context(
// 3003-PMAN-001 // 3003-PMAN-001
it( it(
'Able to submit valid new market proposal', 'Able to submit valid new market proposal',
// @ts-ignore clash between jest and cypress
{ tags: '@smoke' }, { tags: '@smoke' },
function () { function () {
const proposalTitle = 'Test new market proposal'; const proposalTitle = 'Test new market proposal';
@ -631,6 +633,7 @@ context(
); );
cy.fixture('/proposals/successor-market').then((newMarketProposal) => { cy.fixture('/proposals/successor-market').then((newMarketProposal) => {
newMarketProposal.changes.successor.parentMarketId = newMarketProposal.changes.successor.parentMarketId =
// @ts-ignore clash between jest and cypress
this.parentMarketId; this.parentMarketId;
const newMarketPayload = JSON.stringify(newMarketProposal); const newMarketPayload = JSON.stringify(newMarketProposal);
cy.getByTestId(newProposalTerms).type(newMarketPayload, { cy.getByTestId(newProposalTerms).type(newMarketPayload, {
@ -658,6 +661,7 @@ context(
.should('have.text', 'Successor market to: TEST.24h') .should('have.text', 'Successor market to: TEST.24h')
.find('a') .find('a')
.should('have.attr', 'href') .should('have.attr', 'href')
// @ts-ignore clash between jest and cypress
.and('contain', this.parentMarketId); .and('contain', this.parentMarketId);
}); });
}); });

View File

@ -33,12 +33,14 @@ const voteMajorityNotMet = 'token-majority-not-met';
const voteMajorityMet = 'token-majority-met'; const voteMajorityMet = 'token-majority-met';
const votesForPercentage = 'votes-for-percentage'; const votesForPercentage = 'votes-for-percentage';
// @ts-ignore clash between jest and cypress
describe('Governance flow for proposal list', { tags: '@slow' }, function () { describe('Governance flow for proposal list', { tags: '@slow' }, function () {
before('connect wallets and set approval limit', function () { before('connect wallets and set approval limit', function () {
vegaWalletSetSpecifiedApprovalAmount('1000'); vegaWalletSetSpecifiedApprovalAmount('1000');
cy.visit('/'); cy.visit('/');
}); });
// @ts-ignore clash between jest and cypress
beforeEach('visit proposals tab', function () { beforeEach('visit proposals tab', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();
@ -106,6 +108,7 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
it('Newly created proposals list - shows open proposals in an open state', function () { it('Newly created proposals list - shows open proposals in an open state', function () {
// 3001-VOTE-004 // 3001-VOTE-004
// 3001-VOTE-035 // 3001-VOTE-035
// @ts-ignore clash between jest and cypress
createRawProposal(this.minProposerBalance); createRawProposal(this.minProposerBalance);
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => { cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
getProposalFromTitle(rawProposal.rationale.title).within(() => { getProposalFromTitle(rawProposal.rationale.title).within(() => {

View File

@ -64,6 +64,7 @@ context(
describe('Eth wallet - contains VEGA tokens', function () { describe('Eth wallet - contains VEGA tokens', function () {
beforeEach( beforeEach(
// @ts-ignore clash between jest and cypress
'teardown wallet & drill into a specific validator', 'teardown wallet & drill into a specific validator',
function () { function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
@ -237,6 +238,7 @@ context(
// 1002-STKE-041 1002-STKE-053 // 1002-STKE-041 1002-STKE-053
it( it(
'Able to remove part of a stake against a validator', 'Able to remove part of a stake against a validator',
// @ts-ignore clash between jest and cypress
{ tags: '@smoke' }, { tags: '@smoke' },
function () { function () {
ensureSpecifiedUnstakedTokensAreAssociated('4'); ensureSpecifiedUnstakedTokensAreAssociated('4');

View File

@ -52,6 +52,7 @@ context(
describe('Eth wallet - contains VEGA tokens', function () { describe('Eth wallet - contains VEGA tokens', function () {
beforeEach( beforeEach(
// @ts-ignore clash between jest and cypress
'teardown wallet & drill into a specific validator', 'teardown wallet & drill into a specific validator',
function () { function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
@ -67,6 +68,7 @@ context(
it( it(
'Able to associate tokens - from wallet', 'Able to associate tokens - from wallet',
// @ts-ignore clash between jest and cypress
{ tags: '@smoke' }, { tags: '@smoke' },
function () { function () {
//1004-ASSO-003 //1004-ASSO-003

View File

@ -48,6 +48,7 @@ context(
depositAsset(usdcEthAddress, '1000', 5); depositAsset(usdcEthAddress, '1000', 5);
}); });
// @ts-ignore clash between jest and cypress
beforeEach('Navigate to withdrawal page', function () { beforeEach('Navigate to withdrawal page', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();
@ -101,6 +102,7 @@ context(
// eslint-disable-next-line // eslint-disable-next-line
it.skip( it.skip(
'Able to withdraw asset: -eth wallet connected -withdraw funds button', 'Able to withdraw asset: -eth wallet connected -withdraw funds button',
// @ts-ignore clash between jest and cypress
{ tags: '@smoke' }, { tags: '@smoke' },
function () { function () {
// fill in withdrawal form // fill in withdrawal form

View File

@ -25,6 +25,7 @@ context('View functionality with public key', { tags: '@smoke' }, function () {
); );
}); });
// @ts-ignore clash between jest and cypress
beforeEach('visit home page', function () { beforeEach('visit home page', function () {
cy.clearLocalStorage(); cy.clearLocalStorage();
turnTelemetryOff(); turnTelemetryOff();

View File

@ -52,6 +52,7 @@ context(
.invoke('text') .invoke('text')
.then(($newPageNumber) => { .then(($newPageNumber) => {
const newPageNumber = Number($newPageNumber.slice(5)); const newPageNumber = Number($newPageNumber.slice(5));
// @ts-ignore clash between jest and cypress
expect(newPageNumber).to.be.greaterThan(currentPageNumber); expect(newPageNumber).to.be.greaterThan(currentPageNumber);
cy.getByTestId('goto-previous-page').click(); cy.getByTestId('goto-previous-page').click();
cy.getByTestId('page-info').should( cy.getByTestId('page-info').should(

View File

@ -44,6 +44,7 @@ context('Validators Page - verify elements on page', function () {
cy.mockChainId(); cy.mockChainId();
}); });
// @ts-ignore clash between jest and cypress
describe('with wallets disconnected', { tags: '@smoke' }, function () { describe('with wallets disconnected', { tags: '@smoke' }, function () {
it('Should have validators tab highlighted', function () { it('Should have validators tab highlighted', function () {
verifyTabHighlighted(navigation.validators); verifyTabHighlighted(navigation.validators);
@ -76,6 +77,7 @@ context('Validators Page - verify elements on page', function () {
describe( describe(
'Should be able to see validator list from the staking page', 'Should be able to see validator list from the staking page',
{ tags: '@regression' }, { tags: '@regression' },
// @ts-ignore clash between jest and cypress
function () { function () {
// 1002-STKE-050 // 1002-STKE-050
it('Should be able to see validator names', function () { it('Should be able to see validator names', function () {
@ -180,6 +182,7 @@ context('Validators Page - verify elements on page', function () {
describe( describe(
'Should be able to see static information about a validator', 'Should be able to see static information about a validator',
{ tags: '@smoke' }, { tags: '@smoke' },
// @ts-ignore clash between jest and cypress
function () { function () {
before('connect wallets and click on validator', function () { before('connect wallets and click on validator', function () {
cy.mockChainId(); cy.mockChainId();

View File

@ -198,6 +198,7 @@ context(
}); });
}) })
.then(function () { .then(function () {
// @ts-ignore clash between jest and cypress
expect(parseFloat(this.value).toFixed(1)).to.equal( expect(parseFloat(this.value).toFixed(1)).to.equal(
(Math.round((this.locked + this.unlocked) * 100) / 100).toFixed( (Math.round((this.locked + this.unlocked) * 100) / 100).toFixed(
1 1
@ -270,6 +271,7 @@ context(
}); });
}) })
.then(function () { .then(function () {
// @ts-ignore clash between jest and cypress
expect(this.value).to.equal(this.locked + this.unlocked); expect(this.value).to.equal(this.locked + this.unlocked);
}); });
}); });

View File

@ -105,6 +105,7 @@ context(
// 0002-WCON-008 // 0002-WCON-008
it( it(
'should have truncated account number visible', 'should have truncated account number visible',
// @ts-ignore clash between jest and cypress
{ tags: '@smoke' }, { tags: '@smoke' },
function () { function () {
cy.get(walletContainer).within(() => { cy.get(walletContainer).within(() => {
@ -125,6 +126,7 @@ context(
it( it(
'should have Vega Associated currency value visible', 'should have Vega Associated currency value visible',
// @ts-ignore clash between jest and cypress
{ tags: '@smoke' }, { tags: '@smoke' },
function () { function () {
cy.get(walletContainer).within(() => { cy.get(walletContainer).within(() => {
@ -135,14 +137,19 @@ context(
} }
); );
it('should have Unstaked value visible', { tags: '@smoke' }, function () { it(
cy.get(walletContainer).within(() => { 'should have Unstaked value visible',
cy.get(vegaUnstaked) // @ts-ignore clash between jest and cypress
.should('be.visible') { tags: '@smoke' },
.invoke('text') function () {
.and('not.be.empty'); cy.get(walletContainer).within(() => {
}); cy.get(vegaUnstaked)
}); .should('be.visible')
.invoke('text')
.and('not.be.empty');
});
}
);
it('should have Governance button visible', function () { it('should have Governance button visible', function () {
cy.get(walletContainer).within(() => { cy.get(walletContainer).within(() => {
@ -299,6 +306,7 @@ context(
.siblings(txTimeout) .siblings(txTimeout)
.should((elementAmount) => { .should((elementAmount) => {
const displayedAmount = parseFloat(elementAmount.text()); const displayedAmount = parseFloat(elementAmount.text());
// @ts-ignore clash between jest and cypress
expect(displayedAmount).be.gte(expectedAmount); expect(displayedAmount).be.gte(expectedAmount);
}); });

View File

@ -56,7 +56,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/governance/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["apps/governance/**/*.{ts,tsx,js,jsx}"]
@ -66,14 +66,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/governance"], "outputs": ["{workspaceRoot}/coverage/apps/governance"],
"options": { "options": {
"jestConfig": "apps/governance/jest.config.ts", "jestConfig": "apps/governance/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-netlify": { "build-netlify": {

View File

@ -2,7 +2,11 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"types": ["node"] "types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"files": [ "files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/cssmodule.d.ts",

View File

@ -3,7 +3,13 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"module": "commonjs", "module": "commonjs",
"types": ["jest", "node", "@testing-library/jest-dom"] "types": [
"jest",
"node",
"@testing-library/jest-dom",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"include": [ "include": [
"**/*.test.ts", "**/*.test.ts",

View File

@ -3,20 +3,20 @@
# Netlify Environment Variables # Netlify Environment Variables
# https://www.netlify.com/docs/continuous-deployment/#environment-variables # https://www.netlify.com/docs/continuous-deployment/#environment-variables
NX_VERSION=$npm_package_version NX_VERSION=\$npm_package_version
NX_REPOSITORY_URL=$REPOSITORY_URL NX_REPOSITORY_URL=\$REPOSITORY_URL
NX_BRANCH=$BRANCH NX_BRANCH=\$BRANCH
NX_PULL_REQUEST=$PULL_REQUEST NX_PULL_REQUEST=\$PULL_REQUEST
NX_HEAD=$HEAD NX_HEAD=\$HEAD
NX_COMMIT_REF=$COMMIT_REF NX_COMMIT_REF=\$COMMIT_REF
NX_CONTEXT=$CONTEXT NX_CONTEXT=\$CONTEXT
NX_REVIEW_ID=$REVIEW_ID NX_REVIEW_ID=\$REVIEW_ID
NX_INCOMING_HOOK_TITLE=$INCOMING_HOOK_TITLE NX_INCOMING_HOOK_TITLE=\$INCOMING_HOOK_TITLE
NX_INCOMING_HOOK_URL=$INCOMING_HOOK_URL NX_INCOMING_HOOK_URL=\$INCOMING_HOOK_URL
NX_INCOMING_HOOK_BODY=$INCOMING_HOOK_BODY NX_INCOMING_HOOK_BODY=\$INCOMING_HOOK_BODY
NX_URL=$URL NX_URL=\$URL
NX_DEPLOY_URL=$DEPLOY_URL NX_DEPLOY_URL=\$DEPLOY_URL
NX_DEPLOY_PRIME_URL=$DEPLOY_PRIME_URL NX_DEPLOY_PRIME_URL=\$DEPLOY_PRIME_URL
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml
NX_VEGA_ENV = 'TESTNET' NX_VEGA_ENV = 'TESTNET'
NX_VEGA_URL="https://api.n07.testnet.vega.xyz/graphql" NX_VEGA_URL="https://api.n07.testnet.vega.xyz/graphql"

View File

@ -65,7 +65,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": [ "lintFilePatterns": [
@ -79,14 +79,7 @@
"{workspaceRoot}/coverage/apps/liquidity-provision-dashboard" "{workspaceRoot}/coverage/apps/liquidity-provision-dashboard"
], ],
"options": { "options": {
"jestConfig": "apps/liquidity-provision-dashboard/jest.config.ts", "jestConfig": "apps/liquidity-provision-dashboard/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-netlify": { "build-netlify": {

View File

@ -2,7 +2,11 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"types": ["node"] "types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"files": [ "files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/cssmodule.d.ts",

View File

@ -3,7 +3,13 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"module": "commonjs", "module": "commonjs",
"types": ["jest", "node", "@testing-library/jest-dom"], "types": [
"jest",
"node",
"@testing-library/jest-dom",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
],
"jsx": "react", "jsx": "react",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"esModuleInterop": true "esModuleInterop": true

View File

@ -53,7 +53,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/multisig-signer/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["apps/multisig-signer/**/*.{ts,tsx,js,jsx}"]
@ -63,14 +63,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/multisig-signer"], "outputs": ["{workspaceRoot}/coverage/apps/multisig-signer"],
"options": { "options": {
"jestConfig": "apps/multisig-signer/jest.config.ts", "jestConfig": "apps/multisig-signer/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-netlify": { "build-netlify": {

View File

@ -2,7 +2,11 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"types": ["node"] "types": [
"node",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"files": [ "files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts", "../../node_modules/@nx/react/typings/cssmodule.d.ts",

View File

@ -3,7 +3,13 @@
"compilerOptions": { "compilerOptions": {
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"module": "commonjs", "module": "commonjs",
"types": ["jest", "node", "@testing-library/jest-dom"] "types": [
"jest",
"node",
"@testing-library/jest-dom",
"@nx/react/typings/cssmodule.d.ts",
"@nx/react/typings/image.d.ts"
]
}, },
"include": [ "include": [
"**/*.test.ts", "**/*.test.ts",

View File

@ -4,7 +4,9 @@
"overrides": [ "overrides": [
{ {
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {} "rules": {
"cypress/unsafe-to-chain-command": 0
}
}, },
{ {
"files": ["src/plugins/index.js"], "files": ["src/plugins/index.js"],

View File

@ -20,7 +20,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/trading-e2e/**/*.{js,ts}"] "lintFilePatterns": ["apps/trading-e2e/**/*.{js,ts}"]

View File

@ -26,7 +26,7 @@ describe('ethereum wallet', { tags: '@smoke', testIsolation: true }, () => {
cy.getByTestId('tab-deposits').should('not.be.empty'); cy.getByTestId('tab-deposits').should('not.be.empty');
}); });
it('should see QR code modal for WalletConnect', () => { it.skip('should see QR code modal for WalletConnect', () => {
// 0004-EWAL-003 // 0004-EWAL-003
cy.getByTestId('Deposits').click(); cy.getByTestId('Deposits').click();
@ -35,7 +35,7 @@ describe('ethereum wallet', { tags: '@smoke', testIsolation: true }, () => {
cy.getByTestId('web3-connector-list').should('exist'); cy.getByTestId('web3-connector-list').should('exist');
cy.getByTestId('web3-connector-WalletConnect').click(); cy.getByTestId('web3-connector-WalletConnect').click();
// testing if exists rather than visible because of the long loading time // testing if exists rather than visible because of the long loading time
cy.get('w3m-modal').should('exist'); cy.get('#w3m-modal').should('exist');
}); });
it('able to disconnect eth wallet', () => { it('able to disconnect eth wallet', () => {

View File

@ -5,7 +5,7 @@
"next", "next",
"next/core-web-vitals" "next/core-web-vitals"
], ],
"ignorePatterns": ["!**/*", "__generated__", ".next"], "ignorePatterns": ["!**/*", "__generated__", ".next", "setup-tests.ts"],
"overrides": [ "overrides": [
{ {
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],

View File

@ -60,7 +60,7 @@ function AppBody({ Component }: AppProps) {
const location = useLocation(); const location = useLocation();
const { VEGA_ENV } = useEnvironment(); const { VEGA_ENV } = useEnvironment();
const gridClasses = classNames( const gridClasses = classNames(
'h-full relative z-0 grid', 'grid relative h-full z-0',
'grid-rows-[repeat(3,min-content),minmax(0,1fr)]' 'grid-rows-[repeat(3,min-content),minmax(0,1fr)]'
); );
return ( return (

View File

@ -41,18 +41,11 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/trading"], "outputs": ["{workspaceRoot}/coverage/apps/trading"],
"options": { "options": {
"jestConfig": "apps/trading/jest.config.ts", "jestConfig": "apps/trading/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["apps/trading/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["apps/trading/**/*.{ts,tsx,js,jsx}"]

View File

@ -1,3 +1,10 @@
const nxPreset = require('@nx/jest/preset').default; const nxPreset = require('@nx/jest/preset').default;
module.exports = { ...nxPreset }; module.exports = {
...nxPreset,
moduleNameMapper: {
...nxPreset.moduleNameMapper,
// this mapping fixes jest breaking if anything tries to import d3 due to esm exports
'^d3-(.*)$': 'd3-$1/dist/d3-$1',
},
};

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx",
"jest.config.ts"
],
"include": ["../src/**/*", "*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/accounts/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/accounts/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/accounts"], "outputs": ["{workspaceRoot}/coverage/libs/accounts"],
"options": { "options": {
"jestConfig": "libs/accounts/jest.config.ts", "jestConfig": "libs/accounts/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"storybook": { "storybook": {

View File

@ -71,7 +71,25 @@ describe('TransferForm', () => {
minQuantumMultiple: '1', minQuantumMultiple: '1',
}; };
it('form tooltips correctly displayed', async () => { it.each([
{
targetText: 'Include transfer fee',
tooltipText:
'The fee will be taken from the amount you are transferring.',
},
{
targetText: 'Transfer fee',
tooltipText: /transfer\.fee\.factor/,
},
{
targetText: 'Amount to be transferred',
tooltipText: /without the fee/,
},
{
targetText: 'Total amount (with fee)',
tooltipText: /total amount taken from your account/,
},
])('Tooltip for "$targetText" shows', async (o) => {
// 1003-TRAN-015 // 1003-TRAN-015
// 1003-TRAN-016 // 1003-TRAN-016
// 1003-TRAN-017 // 1003-TRAN-017
@ -92,32 +110,9 @@ describe('TransferForm', () => {
await userEvent.type(amountInput, amount); await userEvent.type(amountInput, amount);
expect(amountInput).toHaveValue(amount); expect(amountInput).toHaveValue(amount);
const includeTransferLabel = screen.getByText('Include transfer fee'); const label = screen.getByText(o.targetText);
await userEvent.hover(includeTransferLabel); await userEvent.hover(label);
expect(await screen.findByRole('tooltip')).toHaveTextContent( expect(await screen.findByRole('tooltip')).toHaveTextContent(o.tooltipText);
'The fee will be taken from the amount you are transferring.'
);
await userEvent.unhover(screen.getByText('Include transfer fee'));
const transferFee = screen.getByText('Transfer fee');
await userEvent.hover(transferFee);
expect(await screen.findByRole('tooltip')).toHaveTextContent(
/transfer.fee.factor/
);
await userEvent.unhover(transferFee);
const amountToBeTransferred = screen.getByText('Amount to be transferred');
await userEvent.hover(amountToBeTransferred);
expect(await screen.findByRole('tooltip')).toHaveTextContent(
/without the fee/
);
await userEvent.unhover(amountToBeTransferred);
const totalAmountWithFee = screen.getByText('Total amount (with fee)');
await userEvent.hover(totalAmountWithFee);
expect(await screen.findByRole('tooltip')).toHaveTextContent(
/total amount taken from your account/
);
}); });
it('validates a manually entered address', async () => { it('validates a manually entered address', async () => {

View File

@ -21,7 +21,7 @@
"path": "./tsconfig.spec.json" "path": "./tsconfig.spec.json"
}, },
{ {
"path": "./.storybook/tsconfig.json" "path": "./tsconfig.storybook.json"
} }
] ]
} }

View File

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"src/**/*.spec.ts",
"src/**/*.spec.js",
"src/**/*.spec.tsx",
"src/**/*.spec.jsx",
"jest.config.ts"
],
"include": ["src/**/*", ".storybook/*.js"]
}

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx",
"jest.config.ts"
],
"include": ["../src/**/*", "*.js"]
}

View File

@ -32,7 +32,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/announcements/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/announcements/**/*.{ts,tsx,js,jsx}"]
@ -42,14 +42,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/announcements"], "outputs": ["{workspaceRoot}/coverage/libs/announcements"],
"options": { "options": {
"jestConfig": "libs/announcements/jest.config.ts", "jestConfig": "libs/announcements/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"storybook": { "storybook": {

View File

@ -21,7 +21,7 @@
"path": "./tsconfig.spec.json" "path": "./tsconfig.spec.json"
}, },
{ {
"path": "./.storybook/tsconfig.json" "path": "./tsconfig.storybook.json"
} }
] ]
} }

View File

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"src/**/*.spec.ts",
"src/**/*.spec.js",
"src/**/*.spec.tsx",
"src/**/*.spec.jsx",
"jest.config.ts"
],
"include": ["src/**/*", ".storybook/*.js"]
}

View File

@ -5,7 +5,7 @@
"projectType": "library", "projectType": "library",
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/apollo-client/**/*.ts"] "lintFilePatterns": ["libs/apollo-client/**/*.ts"]
@ -15,14 +15,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/apollo-client"], "outputs": ["{workspaceRoot}/coverage/libs/apollo-client"],
"options": { "options": {
"jestConfig": "libs/apollo-client/jest.config.ts", "jestConfig": "libs/apollo-client/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
}, },

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/assets/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/assets/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/assets"], "outputs": ["{workspaceRoot}/coverage/libs/assets"],
"options": { "options": {
"jestConfig": "libs/assets/jest.config.ts", "jestConfig": "libs/assets/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/candles-chart/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/candles-chart/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/candles-chart"], "outputs": ["{workspaceRoot}/coverage/libs/candles-chart"],
"options": { "options": {
"jestConfig": "libs/candles-chart/jest.config.ts", "jestConfig": "libs/candles-chart/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -5,7 +5,7 @@
"projectType": "library", "projectType": "library",
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/cypress/**/*.ts"] "lintFilePatterns": ["libs/cypress/**/*.ts"]
@ -15,14 +15,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/cypress"], "outputs": ["{workspaceRoot}/coverage/libs/cypress"],
"options": { "options": {
"jestConfig": "libs/cypress/jest.config.ts", "jestConfig": "libs/cypress/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/data-provider/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/data-provider/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/data-provider"], "outputs": ["{workspaceRoot}/coverage/libs/data-provider"],
"options": { "options": {
"jestConfig": "libs/data-provider/jest.config.ts", "jestConfig": "libs/data-provider/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
} }

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/datagrid/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/datagrid/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/datagrid"], "outputs": ["{workspaceRoot}/coverage/libs/datagrid"],
"options": { "options": {
"jestConfig": "libs/datagrid/jest.config.ts", "jestConfig": "libs/datagrid/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
} }

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/deal-ticket/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/deal-ticket/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/deal-ticket"], "outputs": ["{workspaceRoot}/coverage/libs/deal-ticket"],
"options": { "options": {
"jestConfig": "libs/deal-ticket/jest.config.ts", "jestConfig": "libs/deal-ticket/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -1,7 +1,7 @@
import { t } from '@vegaprotocol/i18n'; import { t } from '@vegaprotocol/i18n';
import type { Validate } from 'react-hook-form'; import type { Validate } from 'react-hook-form';
export const validateExpiration: Validate<string | undefined> = ( export const validateExpiration: Validate<string | undefined, object> = (
value?: string value?: string
) => { ) => {
const now = new Date(); const now = new Date();

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/deposits/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/deposits/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/deposits"], "outputs": ["{workspaceRoot}/coverage/libs/deposits"],
"options": { "options": {
"jestConfig": "libs/deposits/jest.config.ts", "jestConfig": "libs/deposits/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/environment/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/environment/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/environment"], "outputs": ["{workspaceRoot}/coverage/libs/environment"],
"options": { "options": {
"jestConfig": "libs/environment/jest.config.ts", "jestConfig": "libs/environment/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -22,7 +22,7 @@ export const useNodeHealth = () => {
}); });
const blockDiff = useMemo(() => { const blockDiff = useMemo(() => {
if (!data?.statistics.blockHeight) { if (!data?.statistics?.blockHeight) {
return null; return null;
} }
@ -31,7 +31,7 @@ export const useNodeHealth = () => {
} }
return Number(data.statistics.blockHeight) - headers.blockHeight; return Number(data.statistics.blockHeight) - headers.blockHeight;
}, [data?.statistics.blockHeight, headers?.blockHeight]); }, [data?.statistics?.blockHeight, headers?.blockHeight]);
useEffect(() => { useEffect(() => {
if (error) { if (error) {

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx",
"jest.config.ts"
],
"include": ["../src/**/*", "*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/fills/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/fills/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/fills"], "outputs": ["{workspaceRoot}/coverage/libs/fills"],
"options": { "options": {
"jestConfig": "libs/fills/jest.config.ts", "jestConfig": "libs/fills/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"storybook": { "storybook": {

View File

@ -21,7 +21,7 @@
"path": "./tsconfig.spec.json" "path": "./tsconfig.spec.json"
}, },
{ {
"path": "./.storybook/tsconfig.json" "path": "./tsconfig.storybook.json"
} }
] ]
} }

View File

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"src/**/*.spec.ts",
"src/**/*.spec.js",
"src/**/*.spec.tsx",
"src/**/*.spec.jsx",
"jest.config.ts"
],
"include": ["src/**/*", ".storybook/*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/funding-payments/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/funding-payments/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/funding-payments"], "outputs": ["{workspaceRoot}/coverage/libs/funding-payments"],
"options": { "options": {
"jestConfig": "libs/funding-payments/jest.config.ts", "jestConfig": "libs/funding-payments/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -16,7 +16,7 @@
} }
}, },
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/i18n/**/*.ts"] "lintFilePatterns": ["libs/i18n/**/*.ts"]
@ -26,14 +26,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/i18n"], "outputs": ["{workspaceRoot}/coverage/libs/i18n"],
"options": { "options": {
"jestConfig": "libs/i18n/jest.config.ts", "jestConfig": "libs/i18n/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
}, },

View File

@ -5,7 +5,7 @@
"projectType": "library", "projectType": "library",
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/ledger/**/*.ts"] "lintFilePatterns": ["libs/ledger/**/*.ts"]
@ -15,14 +15,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/ledger"], "outputs": ["{workspaceRoot}/coverage/libs/ledger"],
"options": { "options": {
"jestConfig": "libs/ledger/jest.config.ts", "jestConfig": "libs/ledger/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
}, },

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/liquidity/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/liquidity/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/liquidity"], "outputs": ["{workspaceRoot}/coverage/libs/liquidity"],
"options": { "options": {
"jestConfig": "libs/liquidity/jest.config.js", "jestConfig": "libs/liquidity/jest.config.js"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -37,7 +37,7 @@ describe('LiquidityTable', () => {
); );
}); });
const headers = await screen.getAllByRole('columnheader'); const headers = await screen.findAllByRole('columnheader');
const headerTexts = headers.map((h) => const headerTexts = headers.map((h) =>
h.querySelector('[ref="eText"]')?.textContent?.trim() h.querySelector('[ref="eText"]')?.textContent?.trim()

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/logger/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/logger/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/logger"], "outputs": ["{workspaceRoot}/coverage/libs/logger"],
"options": { "options": {
"jestConfig": "libs/logger/jest.config.ts", "jestConfig": "libs/logger/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
} }

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx",
"jest.config.ts"
],
"include": ["../src/**/*", "*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/market-depth/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/market-depth/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/market-depth"], "outputs": ["{workspaceRoot}/coverage/libs/market-depth"],
"options": { "options": {
"jestConfig": "libs/market-depth/jest.config.ts", "jestConfig": "libs/market-depth/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"storybook": { "storybook": {

View File

@ -118,7 +118,7 @@ const OrderBookRowCell = ({
}) => { }) => {
return ( return (
<button <button
className="overflow-hidden text-right text-ellipsis whitespace-nowrap hover:dark:bg-neutral-800 hover:bg-neutral-200" className="overflow-hidden text-ellipsis whitespace-nowrap text-right hover:bg-neutral-200 hover:dark:bg-neutral-800"
onClick={onClick} onClick={onClick}
> >
{children} {children}
@ -140,7 +140,7 @@ const CumulationBar = ({
<div <div
data-testid={`${VolumeType.bid === type ? 'bid' : 'ask'}-bar`} data-testid={`${VolumeType.bid === type ? 'bid' : 'ask'}-bar`}
className={classNames( className={classNames(
'absolute top-0 left-0 h-full', 'absolute left-0 top-0 h-full',
type === VolumeType.bid type === VolumeType.bid
? 'bg-market-green/10 dark:bg-market-green/10' ? 'bg-market-green/10 dark:bg-market-green/10'
: 'bg-market-red/10 dark:bg-market-red/10' : 'bg-market-red/10 dark:bg-market-red/10'

View File

@ -1,24 +1,18 @@
import { type ReactNode } from 'react';
import { render, waitFor, screen } from '@testing-library/react'; import { render, waitFor, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event'; import userEvent from '@testing-library/user-event';
import { generateMockData, VolumeType } from './orderbook-data'; import { generateMockData, VolumeType } from './orderbook-data';
import { Orderbook, OrderbookMid } from './orderbook'; import { Orderbook, OrderbookMid } from './orderbook';
import * as orderbookData from './orderbook-data'; import * as orderbookData from './orderbook-data';
import { createResolutions, formatResolution } from './orderbook-controls'; import { createResolutions, formatResolution } from './orderbook-controls';
import { OrderbookRow } from './orderbook-row';
function mockOffsetSize(width: number, height: number) { type AutoSizerChildern = (size: { width: number; height: number }) => ReactNode;
Object.defineProperty(HTMLElement.prototype, 'getBoundingClientRect', {
configurable: true, jest.mock('react-virtualized-auto-sizer', () => {
value: () => ({ height, width }), return ({ children }: { children: AutoSizerChildern }) =>
}); children({ width: 800, height: 768 });
Object.defineProperty(HTMLElement.prototype, 'offsetHeight', { });
configurable: true,
value: height,
});
Object.defineProperty(HTMLElement.prototype, 'offsetWidth', {
configurable: true,
value: width,
});
}
describe('Orderbook', () => { describe('Orderbook', () => {
const params = { const params = {
@ -34,11 +28,6 @@ describe('Orderbook', () => {
}; };
const decimalPlaces = 3; const decimalPlaces = 3;
beforeEach(() => {
jest.clearAllMocks();
mockOffsetSize(800, 768);
});
it('lastTradedPrice should be in the middle', async () => { it('lastTradedPrice should be in the middle', async () => {
render( render(
<Orderbook <Orderbook
@ -149,18 +138,22 @@ describe('Orderbook', () => {
}); });
expect(screen.getByTestId('plus-button')).toBeDisabled(); expect(screen.getByTestId('plus-button')).toBeDisabled();
}); });
});
describe('OrderbookRow', () => {
it('two columns', () => { it('two columns', () => {
mockOffsetSize(200, 768);
const onClickSpy = jest.fn();
const mockedData = generateMockData(params);
render( render(
<Orderbook <OrderbookRow
decimalPlaces={decimalPlaces} volume={10}
cumulativeVolume={10}
decimalPlaces={0}
positionDecimalPlaces={0} positionDecimalPlaces={0}
onClick={onClickSpy} priceFormatDecimalPlaces={0}
{...mockedData} price="10"
assetSymbol="USD" onClick={jest.fn()}
type={VolumeType.bid}
width={200}
maxVol={10}
/> />
); );
screen.getAllByTestId('bid-rows-container').forEach((item) => { screen.getAllByTestId('bid-rows-container').forEach((item) => {
@ -169,16 +162,18 @@ describe('Orderbook', () => {
}); });
it('one column', () => { it('one column', () => {
mockOffsetSize(140, 768);
const onClickSpy = jest.fn();
const mockedData = generateMockData(params);
render( render(
<Orderbook <OrderbookRow
decimalPlaces={decimalPlaces} volume={10}
cumulativeVolume={10}
decimalPlaces={0}
positionDecimalPlaces={0} positionDecimalPlaces={0}
onClick={onClickSpy} priceFormatDecimalPlaces={0}
{...mockedData} price="10"
assetSymbol="USD" onClick={jest.fn()}
type={VolumeType.ask}
width={140}
maxVol={10}
/> />
); );
screen.getAllByTestId('ask-rows-container').forEach((item) => { screen.getAllByTestId('ask-rows-container').forEach((item) => {

View File

@ -21,7 +21,7 @@
"path": "./tsconfig.spec.json" "path": "./tsconfig.spec.json"
}, },
{ {
"path": "./.storybook/tsconfig.json" "path": "./tsconfig.storybook.json"
} }
] ]
} }

View File

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"src/**/*.spec.ts",
"src/**/*.spec.js",
"src/**/*.spec.tsx",
"src/**/*.spec.jsx",
"jest.config.ts"
],
"include": ["src/**/*", ".storybook/*.js"]
}

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx",
"jest.config.ts"
],
"include": ["../src/**/*", "*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/markets/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/markets/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/markets"], "outputs": ["{workspaceRoot}/coverage/libs/markets"],
"options": { "options": {
"jestConfig": "libs/markets/jest.config.ts", "jestConfig": "libs/markets/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"storybook": { "storybook": {

View File

@ -21,7 +21,7 @@
"path": "./tsconfig.spec.json" "path": "./tsconfig.spec.json"
}, },
{ {
"path": "./.storybook/tsconfig.json" "path": "./tsconfig.storybook.json"
} }
] ]
} }

View File

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"src/**/*.spec.ts",
"src/**/*.spec.js",
"src/**/*.spec.tsx",
"src/**/*.spec.jsx",
"jest.config.ts"
],
"include": ["src/**/*", ".storybook/*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/network-info/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/network-info/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/network-info"], "outputs": ["{workspaceRoot}/coverage/libs/network-info"],
"options": { "options": {
"jestConfig": "libs/network-info/jest.config.ts", "jestConfig": "libs/network-info/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/network-parameters/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/network-parameters/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/network-parameters"], "outputs": ["{workspaceRoot}/coverage/libs/network-parameters"],
"options": { "options": {
"jestConfig": "libs/network-parameters/jest.config.ts", "jestConfig": "libs/network-parameters/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
} }
} }

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/network-stats/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/network-stats/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/network-stats"], "outputs": ["{workspaceRoot}/coverage/libs/network-stats"],
"options": { "options": {
"jestConfig": "libs/network-stats/jest.config.ts", "jestConfig": "libs/network-stats/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"build-spec": { "build-spec": {

View File

@ -1,20 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"../**/*.spec.ts",
"../**/*.spec.js",
"../**/*.spec.tsx",
"../**/*.spec.jsx",
"jest.config.ts"
],
"include": ["../src/**/*", "*.js"]
}

View File

@ -6,7 +6,7 @@
"tags": [], "tags": [],
"targets": { "targets": {
"lint": { "lint": {
"executor": "@nx/linter:eslint", "executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/orders/**/*.{ts,tsx,js,jsx}"] "lintFilePatterns": ["libs/orders/**/*.{ts,tsx,js,jsx}"]
@ -16,14 +16,7 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/libs/orders"], "outputs": ["{workspaceRoot}/coverage/libs/orders"],
"options": { "options": {
"jestConfig": "libs/orders/jest.config.ts", "jestConfig": "libs/orders/jest.config.ts"
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
} }
}, },
"storybook": { "storybook": {

View File

@ -21,7 +21,7 @@
"path": "./tsconfig.spec.json" "path": "./tsconfig.spec.json"
}, },
{ {
"path": "./.storybook/tsconfig.json" "path": "./tsconfig.storybook.json"
} }
] ]
} }

View File

@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"outDir": ""
},
"files": [
"../../node_modules/@nx/react/typings/styled-jsx.d.ts",
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
"../../node_modules/@nx/react/typings/image.d.ts"
],
"exclude": [
"src/**/*.spec.ts",
"src/**/*.spec.js",
"src/**/*.spec.tsx",
"src/**/*.spec.jsx",
"jest.config.ts"
],
"include": ["src/**/*", ".storybook/*.js"]
}

Some files were not shown because too many files have changed in this diff Show More