Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suite #175

Merged
merged 8 commits into from
Dec 11, 2023
Merged

Suite #175

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cypress/e2e/wallet_balance.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { expect } from 'chai'
import '@cypress/xpath'

describe('Wallet Balance Mnemonic', { tags: ['@wallet', '@suite'] }, () => {
Expand Down
67 changes: 23 additions & 44 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,44 +96,29 @@ Cypress.Commands.add('changeNetwork', (network: string = 'Kopernikus') => {
})
})
Cypress.Commands.add('accessWallet', (type, keyName, networkName: string = 'kopernikus') => {
//cy.get('header > .MuiToolbar-root > .MuiBox-root:nth-child(2)').as('elPreferenceMenu')
// cy.get('@elPreferenceMenu').find('> .MuiBox-root').as('btnWallet')
// cy.get('@btnWallet').click()

cy.selectWalletApp()
cy.wait(5000)
cy.get('h6 + .MuiGrid-container').as('elWalletOptions')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(1)')
.as('elPrivateKeyOption')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(2)')
.as('elMnemonicOption')
switch (type) {
case 'privateKey':
{
cy.get('@elPrivateKeyOption').click()
cy.fixture(`${networkName}/private_key_wallet`).then(privateKeys => {
cy.get('[data-cy="field-private-key"]').type(
privateKeys[keyName || 'privateKey'],
)
})
cy.get('button[type="button"]').contains('Access Wallet').click()
}
break
case 'mnemonic':
{
cy.get('@elMnemonicOption').find('> .MuiButtonBase-root').click()
console.log(networkName)
cy.fixture(`${networkName}/mnemonic_wallet`).then(phraseArr => {
const mnemonicStr = phraseArr.join(' ')
cy.get('input.phrase_word').first()?.type(mnemonicStr)
cy.get('button[type="button"]').contains('Access Wallet').click()
})
cy.get('[data-cy="app-selector-menu"]').click()
cy.get('[data-cy="app-selector-Wallet"]').click()

if (type === 'mnemonic') {
cy.get('[data-cy="btn-wallet-access-mnemonic"]').click()
cy.readFile(`cypress/temp/wallets/mnemonic_wallet.json`).then(data => {
let phraseArr = data
for (let i = 0; i < phraseArr.length; i++) {
let indexInput = i + 1
cy.get(`[data-cy="mnemonic-field-${indexInput}"]`).type(phraseArr[i])
}
break
default:
break
cy.get('[data-cy="btn-submit-mnemonic-phrase"]').click({ force: true })
})
}
if (type === 'privateKey') {
cy.get('[data-cy="btn-wallet-access-private-key"]', { timeout: 10000 }).click()
cy.readFile('cypress/temp/wallets/private_key_wallet.json').then(privateKey => {
const privateKeyCChain = privateKey.privateKey
cy.get('[data-cy="field-private-key"]', { timeout: 10000 }).type(privateKeyCChain)
})
cy.get('[data-cy="btn-submit-private-key"]').click()
}
cy.get('[data-cy="btn-show-breakdown"]', { timeout: 20000 }).should('be.visible')
// cy.intercept('GET', '**/api/v1/verified/*').as('apiVerifiedAddress')
Expand Down Expand Up @@ -217,17 +202,11 @@ Cypress.Commands.add(
cy.changeNetwork(network)

cy.wait(5000)
cy.get('h6 + .MuiGrid-container').as('elWalletOptions')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(1)')
.as('elPrivateKeyOption')
cy.get('@elWalletOptions')
.find('> .MuiGrid-container:nth-child(1) > :nth-child(2)')
.as('elMnemonicOption')

switch (walletAccessType) {
case 'privateKey':
{
cy.get('@elPrivateKeyOption').click()
cy.get('[data-cy="btn-wallet-access-private-key"]').click()
cy.fixture(`${network.toLowerCase()}/private_key_wallet`).then(privateKeys => {
cy.get('[data-cy="field-private-key"]').type(
privateKeys[keyName || 'privateKey'],
Expand All @@ -238,7 +217,7 @@ Cypress.Commands.add(
break
case 'mnemonic':
{
cy.get('@elMnemonicOption').find('> .MuiButtonBase-root').click()
cy.get('[data-cy="btn-wallet-access-mnemonic"]').click()
console.log(network)
cy.fixture(`${network.toLowerCase()}/mnemonic_wallet`).then(phraseArr => {
const mnemonicStr = phraseArr.join(' ')
Expand Down
Binary file removed public/fonts/ClashDisplay-200.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-200.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-300.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-300.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-400.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-400.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-500.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-500.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-600.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-600.woff2
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-700.woff
Binary file not shown.
Binary file removed public/fonts/ClashDisplay-700.woff2
Binary file not shown.
51 changes: 1 addition & 50 deletions public/fonts/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,53 +38,4 @@
font-style: normal;
font-weight: 700;
src: url('Inter-700.woff2') format('woff2'), url('Inter-700.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 200;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-200.woff2') format('woff2'), url('ClashDisplay-200.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 300;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-300.woff2') format('woff2'), url('ClashDisplay-300.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 400;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-400.woff2') format('woff2'), url('ClashDisplay-400.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 500;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-500.woff2') format('woff2'), url('ClashDisplay-500.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 600;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-600.woff2') format('woff2'), url('ClashDisplay-600.woff') format('woff');
}

@font-face {
font-family: 'ClashDisplay';
font-weight: 700;
font-display: swap;
font-style: normal;
src: url('ClashDisplay-700.woff2') format('woff2'), url('ClashDisplay-700.woff') format('woff');
}

}
8 changes: 6 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export const getChains = createAsyncThunk('appConfig/chains', async () => {
})

export async function getMultisigAliases(ownersAddresses: string[]): Promise<string[]> {
let res = await axios.get(`${getBaseUrl()}/v2/multisigalias/${ownersAddresses.join(',')}`)
return res.data.alias
try {
let res = await axios.get(`${getBaseUrl()}/v2/multisigalias/${ownersAddresses.join(',')}`)
return res.data.alias
} catch (e) {
return []
}
}
10 changes: 5 additions & 5 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function Footer() {
sx={{ display: 'flex', flexDirection: 'column' }}
>
<Typography
variant="subtitle1"
variant="body1"
component="span"
fontWeight="fontWeightBold"
sx={{
Expand Down Expand Up @@ -139,7 +139,7 @@ export default function Footer() {
style={{ textDecoration: 'none' }}
>
<Typography
variant="body1"
variant="body2"
component="span"
sx={{ color: 'grey.500' }}
>
Expand All @@ -157,7 +157,7 @@ export default function Footer() {
<Grid container sx={{ mt: 2 }} justifyContent="space-between">
<Grid item xs={12} md={6}>
<Typography
variant="subtitle1"
variant="body1"
component="p"
sx={{
textAlign: { xs: 'center', md: 'left' },
Expand Down Expand Up @@ -194,10 +194,10 @@ export default function Footer() {
<Link
rel="noopener noreferrer"
target="_blank"
style={{ textDecoration: 'none' }}
style={{ textDecoration: 'none', color: 'inherit' }}
to={SUITE_RELEASES}
>
<Typography variant="body1" component="p" color="primary">
<Typography variant="body2" component="p" color="inherit">
{process.env.VERSION}
</Typography>
</Link>
Expand Down
17 changes: 17 additions & 0 deletions src/components/Navbar/CreateDepositButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Typography } from '@mui/material'
import React from 'react'
import { useAppSelector } from '../../hooks/reduxHooks'
import { getActiveApp, getAllApps } from '../../redux/slices/app-config'

const CreateDepositButton = () => {
const activeApp = useAppSelector(getActiveApp)
const allApps = useAppSelector(getAllApps)
if (true && allApps[activeApp].name === 'Partners')
return (
<>
<Typography variant="subtitle1"> Create new depositOffer </Typography>
</>
)
}

export default CreateDepositButton
27 changes: 11 additions & 16 deletions src/components/Navbar/LoginButton.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import React from 'react'
import { useAppDispatch, useAppSelector } from '../../hooks/reduxHooks'
import { MenuItem, MenuList, Select, IconButton, useTheme, Typography, Chip } from '@mui/material'
import store from 'wallet/store'
import { useNavigate } from 'react-router-dom'
import {
getAccount,
updateAuthStatus,
updateAccount,
changeActiveApp,
} from '../../redux/slices/app-config'
import { mdiLogout, mdiCogOutline } from '@mdi/js'
import { mdiCogOutline, mdiLogout } from '@mdi/js'
import Icon from '@mdi/react'
import { Chip, IconButton, MenuItem, MenuList, Select, Typography, useTheme } from '@mui/material'
import { default as React } from 'react'
import { useNavigate } from 'react-router-dom'
import store from 'wallet/store'
import { useAppDispatch, useAppSelector } from '../../hooks/reduxHooks'
import { changeActiveApp, getAccount, updateAccount } from '../../redux/slices/app-config'
import { updateAuthStatus } from '../../redux/slices/utils'
import MHidden from '../@material-extend/MHidden'
import { LoadAccountMenu } from '../LoadAccountMenu'
import AliasPicker from './AliasPicker'
Expand Down Expand Up @@ -108,10 +104,9 @@ export default function LoginButton({ handleCloseSidebar }: LoginIconProps) {
handleKeyDown(e)
}}
sx={{
typography: 'body1',
typography: 'body2',
width: '100%',
maxWidth: '326px',
display: 'flex',
justifyContent: { xs: 'flex-end', sm: 'center' },
}}
>
Expand All @@ -124,7 +119,7 @@ export default function LoginButton({ handleCloseSidebar }: LoginIconProps) {
onKeyDown={e => {
handleKeyDown(e)
}}
sx={{ typography: 'body1', width: '100%', maxWidth: '326px' }}
sx={{ typography: 'body2', width: '100%', maxWidth: '326px' }}
>
<LoadAccountMenu type="kyc" />
</MenuItem>
Expand Down Expand Up @@ -157,7 +152,7 @@ export default function LoginButton({ handleCloseSidebar }: LoginIconProps) {
onKeyDown={e => handleKeyDown(e)}
onClick={logout}
sx={{
typography: 'body1',
typography: 'body2',
width: '100%',
maxWidth: '326px',
display: 'flex',
Expand Down
11 changes: 6 additions & 5 deletions src/components/Navbar/NetworkSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
<MenuList sx={{ bgcolor: 'transparent' }}>
<MenuItem
sx={{
typography: 'h6',
typography: 'body2',
fontWeight: theme.typography.fontWeightMedium,
color: theme.palette.text.disabled,
}}
Expand Down Expand Up @@ -111,7 +111,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
}}
/>
<Typography
variant="subtitle1"
variant="body2"
component="span"
noWrap
sx={{ maxWidth: '180px' }}
Expand Down Expand Up @@ -153,7 +153,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
<MenuItem
onClick={openModal}
sx={{
typography: 'body1',
typography: 'body2',
width: '100%',
maxWidth: '326px',
justifyContent: 'space-between',
Expand Down Expand Up @@ -182,6 +182,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
value={activeNetwork?.name ? activeNetwork?.name : ''}
renderValue={() => <SelectedNetwork />}
sx={{
typography: 'body2',
maxWidth: '13rem',
'.MuiOutlinedInput-notchedOutline': { border: 'none' },
'.MuiSvgIcon-root': { color: theme.palette.text.primary },
Expand All @@ -199,7 +200,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
sx={{ gap: '.6rem', justifyContent: 'space-between' }}
data-cy={`network-name-${network.name}`}
>
<Typography variant="subtitle1" component="span" noWrap>
<Typography variant="body2" component="span" noWrap>
{network.name}
</Typography>
{!network.readonly && network.url !== activeNetwork.url && (
Expand Down Expand Up @@ -248,7 +249,7 @@ export default function NetworkSwitcher({ handleCloseSidebar }: NetworkSwitcherP
))}
<MenuItem
onClick={handleOpenModal}
sx={{ typography: 'body1', width: '100%', maxWidth: '326px' }}
sx={{ typography: 'body2', width: '100%', maxWidth: '326px' }}
data-cy="add-custom-network"
>
Add Custom Network
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/SelectNetwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function SelectedNetwork() {
}}
/>
<Typography
variant="subtitle1"
variant="body2"
component="span"
sx={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/ThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function ThemeSwitcher() {
'.MuiButton-startIcon': { mr: isDesktop ? '0.5rem' : '0rem' },
}}
>
{isDesktop && <Typography variant="subtitle1">{theme.palette.mode}</Typography>}
{isDesktop && <Typography variant="body2">{theme.palette.mode}</Typography>}
</Button>
)
}
5 changes: 3 additions & 2 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import ThemeSwitcher from './ThemeSwitcher'
import LoginButton from './LoginButton'
import MHidden from '../@material-extend/MHidden'
import MIconButton from '../@material-extend/MIconButton'
import { updateAccount, updateAuthStatus } from '../../redux/slices/app-config'
import { updateAccount } from '../../redux/slices/app-config'
import store from 'wallet/store'
import { TIMEOUT_DURATION, DRAWER_WIDTH } from '../../constants/apps-consts'
import AliasPicker from './AliasPicker'
import { updateAuthStatus } from '../../redux/slices/utils'

export default function Navbar() {
const theme = useTheme()
Expand Down Expand Up @@ -160,7 +161,7 @@ export default function Navbar() {
}}
>
<Icon path={mdiWalletOutline} size={1} />
<Typography variant="subtitle1" component="span">
<Typography variant="body2" component="span">
Login
</Typography>
</Box>
Expand Down
Loading
Loading