From 84dc70b5eb2341dfc0174981b1bba3e0e73b36bd Mon Sep 17 00:00:00 2001 From: Thibaut Sardan Date: Fri, 22 Nov 2024 15:51:57 +0000 Subject: [PATCH] fix build --- packages/ui/cypress/tests/setIdentity.cy.ts | 116 +++++++++--------- .../src/components/library/Autocomplete.tsx | 18 +-- .../src/components/select/OptionMenuItem.tsx | 1 - packages/ui/src/styles/theme.ts | 2 +- 4 files changed, 69 insertions(+), 68 deletions(-) diff --git a/packages/ui/cypress/tests/setIdentity.cy.ts b/packages/ui/cypress/tests/setIdentity.cy.ts index a44a167c..8619f291 100644 --- a/packages/ui/cypress/tests/setIdentity.cy.ts +++ b/packages/ui/cypress/tests/setIdentity.cy.ts @@ -1,10 +1,10 @@ -import { landingPageNetwork, landingPageUrl } from '../fixtures/landingData' +import { landingPageNetwork } from '../fixtures/landingData' import { setIdentityMultisigs } from '../fixtures/setIdentity/setIdentityMultisigs' import { setIdentitySignatories } from '../fixtures/setIdentity/setIdentitySignatories' import { multisigPage } from '../support/page-objects/multisigPage' import { sendTxModal } from '../support/page-objects/sendTxModal' import { topMenuItems } from '../support/page-objects/topMenuItems' -import { waitForTxRequest } from '../utils/waitForTxRequests' +// import { waitForTxRequest } from '../utils/waitForTxRequests' describe('Set an identity', () => { // joystream network isn't supported any more. @@ -25,69 +25,69 @@ describe('Set an identity', () => { sendTxModal.selectionEasySetupSetIdentity().should('not.exist') }) - it.skip('Can set an identity from the options menu', () => { - const multisigSignatoryWithoutIdentity = setIdentitySignatories[1] - cy.setupAndVisit({ - url: landingPageUrl, - extensionConnectionAllowed: true, - injectExtensionWithAccounts: [multisigSignatoryWithoutIdentity] - }) - multisigPage.optionsMenuButton().click() - multisigPage.setIdentityMenuOption().should('be.visible').click() - sendTxModal.sendTxTitle().should('be.visible') - sendTxModal.setIdentitySection().should('be.visible') + // it.skip('Can set an identity from the options menu', () => { + // const multisigSignatoryWithoutIdentity = setIdentitySignatories[1] + // cy.setupAndVisit({ + // url: landingPageUrl, + // extensionConnectionAllowed: true, + // injectExtensionWithAccounts: [multisigSignatoryWithoutIdentity] + // }) + // multisigPage.optionsMenuButton().click() + // multisigPage.setIdentityMenuOption().should('be.visible').click() + // sendTxModal.sendTxTitle().should('be.visible') + // sendTxModal.setIdentitySection().should('be.visible') - // every field is empty to start with - sendTxModal.setIdentityFieldInput('display').should('have.value', '') - sendTxModal.setIdentityFieldInput('legal').should('have.value', '') + // // every field is empty to start with + // sendTxModal.setIdentityFieldInput('display').should('have.value', '') + // sendTxModal.setIdentityFieldInput('legal').should('have.value', '') - // typing into legal with empty display should show an error - sendTxModal.setIdentityField('legal').type('le') - sendTxModal.sendTxError().should('contain', 'Display name is required') - sendTxModal.setIdentityFieldElement('display', 'label').should('have.class', 'Mui-error') - sendTxModal.setIdentityFieldElement('display', 'div').should('have.class', 'Mui-error') - sendTxModal.buttonSend().should('be.disabled') + // // typing into legal with empty display should show an error + // sendTxModal.setIdentityField('legal').type('le') + // sendTxModal.sendTxError().should('contain', 'Display name is required') + // sendTxModal.setIdentityFieldElement('display', 'label').should('have.class', 'Mui-error') + // sendTxModal.setIdentityFieldElement('display', 'div').should('have.class', 'Mui-error') + // sendTxModal.buttonSend().should('be.disabled') - // typing into display should remove the error - sendTxModal.setIdentityField('display').type('diis') - sendTxModal.sendTxError().should('not.exist') - sendTxModal.setIdentityFieldElement('display', 'label').should('not.have.class', 'Mui-error') - sendTxModal.buttonSend().should('be.enabled') + // // typing into display should remove the error + // sendTxModal.setIdentityField('display').type('diis') + // sendTxModal.sendTxError().should('not.exist') + // sendTxModal.setIdentityFieldElement('display', 'label').should('not.have.class', 'Mui-error') + // sendTxModal.buttonSend().should('be.enabled') - // typing a too long field should show another error - sendTxModal.setIdentityField('legal').type('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') - sendTxModal.sendTxError().should('contain', 'A field exceeds the 32 character limit') - sendTxModal.setIdentityFieldElement('legal', 'label').should('have.class', 'Mui-error') - sendTxModal.buttonSend().should('be.disabled') + // // typing a too long field should show another error + // sendTxModal.setIdentityField('legal').type('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + // sendTxModal.sendTxError().should('contain', 'A field exceeds the 32 character limit') + // sendTxModal.setIdentityFieldElement('legal', 'label').should('have.class', 'Mui-error') + // sendTxModal.buttonSend().should('be.disabled') - // too many bytes should show the From error - sendTxModal.setIdentityField('legal').type('{selectall}{del}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') - sendTxModal.setIdentityFieldElement('legal', 'label').should('not.have.class', 'Mui-error') - sendTxModal.sendTxError().should('contain', `The "From" account doesn't have`) - sendTxModal.buttonSend().should('be.disabled') + // // too many bytes should show the From error + // sendTxModal.setIdentityField('legal').type('{selectall}{del}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') + // sendTxModal.setIdentityFieldElement('legal', 'label').should('not.have.class', 'Mui-error') + // sendTxModal.sendTxError().should('contain', `The "From" account doesn't have`) + // sendTxModal.buttonSend().should('be.disabled') - // removing should remove the error - sendTxModal.setIdentityField('legal').type('{selectall}{del}leeg') - sendTxModal.sendTxError().should('not.exist') - sendTxModal.setIdentityFieldElement('legal', 'label').should('not.have.class', 'Mui-error') - sendTxModal.buttonSend().should('be.enabled') + // // removing should remove the error + // sendTxModal.setIdentityField('legal').type('{selectall}{del}leeg') + // sendTxModal.sendTxError().should('not.exist') + // sendTxModal.setIdentityFieldElement('legal', 'label').should('not.have.class', 'Mui-error') + // sendTxModal.buttonSend().should('be.enabled') - // verify the tx it sends - sendTxModal.buttonSend().click() - waitForTxRequest() - cy.getTxRequests().then((req) => { - const txRequests = Object.values(req) - cy.wrap(txRequests.length).should('eq', 1) - cy.wrap(txRequests[0].payload.address).should('eq', multisigSignatoryWithoutIdentity.address) - sendTxModal.buttonSend().should('not.exist') - sendTxModal.buttonSending().should('be.visible') - // expected https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/extrinsics/decode/0x1f0102000412ad770206045069201514711dc2456908b0af226442d475d12a5334e9c4513e001901000564696973056c6565670000000000000000 - cy.wrap(txRequests[0].payload.method).should( - 'eq', - '0x1f0102000412ad770206045069201514711dc2456908b0af226442d475d12a5334e9c4513e001901000564696973056c6565670000000000000000' - ) - }) - }) + // // verify the tx it sends + // sendTxModal.buttonSend().click() + // waitForTxRequest() + // cy.getTxRequests().then((req) => { + // const txRequests = Object.values(req) + // cy.wrap(txRequests.length).should('eq', 1) + // cy.wrap(txRequests[0].payload.address).should('eq', multisigSignatoryWithoutIdentity.address) + // sendTxModal.buttonSend().should('not.exist') + // sendTxModal.buttonSending().should('be.visible') + // // expected https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/extrinsics/decode/0x1f0102000412ad770206045069201514711dc2456908b0af226442d475d12a5334e9c4513e001901000564696973056c6565670000000000000000 + // cy.wrap(txRequests[0].payload.method).should( + // 'eq', + // '0x1f0102000412ad770206045069201514711dc2456908b0af226442d475d12a5334e9c4513e001901000564696973056c6565670000000000000000' + // ) + // }) + // }) // skipping since identity now needs to be handled with the associatedppl chain it.skip('Can edit an identity from the new tx button', () => { diff --git a/packages/ui/src/components/library/Autocomplete.tsx b/packages/ui/src/components/library/Autocomplete.tsx index 85fc53e7..94b947e9 100644 --- a/packages/ui/src/components/library/Autocomplete.tsx +++ b/packages/ui/src/components/library/Autocomplete.tsx @@ -1,17 +1,19 @@ -import { Autocomplete as AutocompleteMui, Box, Popper } from '@mui/material' +import { + AutocompleteFreeSoloValueMapping, + Autocomplete as AutocompleteMui, + Box, + FilterOptionsState, + Popper +} from '@mui/material' import React from 'react' import { styled } from '@mui/material/styles' import { + AutocompleteInputChangeReason, AutocompleteRenderInputParams, - AutocompleteRenderOptionState + AutocompleteRenderOptionState, + AutocompleteValue } from '@mui/material/Autocomplete/Autocomplete' import { HiOutlineChevronDown } from 'react-icons/hi2' -import { - AutocompleteFreeSoloValueMapping, - AutocompleteInputChangeReason, - AutocompleteValue, - FilterOptionsState -} from '@mui/base/useAutocomplete/useAutocomplete' import { theme } from '../../styles/theme' interface AutocompleteProps { diff --git a/packages/ui/src/components/select/OptionMenuItem.tsx b/packages/ui/src/components/select/OptionMenuItem.tsx index b99a3be1..10f203fb 100644 --- a/packages/ui/src/components/select/OptionMenuItem.tsx +++ b/packages/ui/src/components/select/OptionMenuItem.tsx @@ -10,7 +10,6 @@ interface OptionMenuProps { const OptionMenuItem = ({ keyValue, children, ...props }: OptionMenuProps) => ( {children} diff --git a/packages/ui/src/styles/theme.ts b/packages/ui/src/styles/theme.ts index 20362772..4c1245b7 100644 --- a/packages/ui/src/styles/theme.ts +++ b/packages/ui/src/styles/theme.ts @@ -196,4 +196,4 @@ export const theme = createTheme({ red: 'firebrick' } } -} as ThemeOptions) +} as Omit)