diff --git a/cashtab/src/components/Agora/__tests__/index.test.js b/cashtab/src/components/Agora/__tests__/index.test.js --- a/cashtab/src/components/Agora/__tests__/index.test.js +++ b/cashtab/src/components/Agora/__tests__/index.test.js @@ -514,7 +514,7 @@ screen.getByText('Agora Partial Beta'), ); - expect(await screen.findByText('42.00 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/42\.00.*XEC/)).toBeInTheDocument(); // Wait for tokens to re-load (triggered by wallet change) await waitFor(() => diff --git a/cashtab/src/components/App/App.js b/cashtab/src/components/App/App.js --- a/cashtab/src/components/App/App.js +++ b/cashtab/src/components/App/App.js @@ -2,7 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import { HomeIcon, SendIcon, @@ -79,9 +79,9 @@ EasterEgg, NavHeader, BalanceHeaderContainer, + LogoCtn, } from 'components/App/styles'; import 'react-toastify/dist/ReactToastify.min.css'; -import debounce from 'lodash.debounce'; const App = () => { const ContextValue = React.useContext(WalletContext); @@ -97,8 +97,6 @@ const walletState = getWalletState(wallet); const { balanceSats } = walletState; const [navMenuClicked, setNavMenuClicked] = useState(false); - const [scrollY, setScrollY] = useState(0); - const [minifiedMenu, setMinifiedMenu] = useState(false); const handleNavMenuClick = () => setNavMenuClicked(!navMenuClicked); // If wallet is unmigrated, do not show page until it has migrated // An invalid wallet will be validated/populated after the next API call, ETA 10s @@ -106,36 +104,6 @@ const location = useLocation(); const navigate = useNavigate(); - const PIN_MINIFIED_WALLET_MENU_SCROLLY = 63; - const UNPIN_MINIFIED_WALLET_MENU_SCROLLY = 15; - const handleScroll = () => { - setScrollY(window.scrollY); - }; - useEffect(() => { - if (scrollY > PIN_MINIFIED_WALLET_MENU_SCROLLY && !minifiedMenu) { - // If the user has scrolled DOWN past PIN_MINIFIED_WALLET_MENU_SCROLLY and the menu IS NOT minified - // Minify the menu - setMinifiedMenu(true); - } else if ( - scrollY < UNPIN_MINIFIED_WALLET_MENU_SCROLLY && - minifiedMenu - ) { - // If the user has scrolled UP past UNPIN_MINIFIED_WALLET_MENU_SCROLLY and the menu IS minified - // Unminify the menu - setMinifiedMenu(false); - } - }, [scrollY, minifiedMenu]); - - // Only execute handleScroll if it has not been called for 25ms - const debouncedHandleScroll = debounce(handleScroll, 25); - - useEffect(() => { - window.addEventListener('scroll', debouncedHandleScroll); - return () => { - window.removeEventListener('scroll', debouncedHandleScroll); - }; - }, []); - // Easter egg boolean not used in extension/src/components/App.js const hasTab = validWallet ? hasEnoughToken( @@ -185,96 +153,103 @@ ) : ( <> <HeaderCtn> - {process.env.REACT_APP_BUILD_ENV === - 'extension' ? ( - <ExtensionHeader - path={location.pathname} - /> - ) : ( - <CashtabLogo - src={Cashtab} - alt="cashtab" - /> - )} - {location.pathname === - '/airdrop' && ( - <NavHeader> - Airdrop - <AirdropIcon /> - </NavHeader> - )} - {location.pathname === - '/backup' && ( - <NavHeader> - Wallet Backup - <WalletIcon /> - </NavHeader> - )} - {location.pathname === '/nfts' && ( - <NavHeader> - Listed NFTs - <NftIcon /> - </NavHeader> - )} - {location.pathname === '/agora' && ( - <NavHeader> - Agora - <DogeIcon /> - </NavHeader> - )} - {location.pathname === - '/contacts' && ( - <NavHeader> - Contacts - <ContactsIcon /> - </NavHeader> - )} - {location.pathname === - '/wallets' && ( - <NavHeader> - Wallets - <BankIcon /> - </NavHeader> - )} - {location.pathname === - '/configure' && ( - <NavHeader> - Settings - <SettingsIcon /> - </NavHeader> - )} - {location.pathname === - '/signverifymsg' && ( - <NavHeader> - {' '} - Sign & Verify Msg - <ThemedSignAndVerifyMsg /> - </NavHeader> - )} - {location.pathname === - '/rewards' && ( - <NavHeader> - {' '} - Rewards - <RewardIcon /> - </NavHeader> - )} - {process.env.REACT_APP_BUILD_ENV !== - 'extension' && - process.env - .REACT_APP_TESTNET !== - 'true' && ( - <> - {location.pathname === - '/swap' && ( - <NavHeader> - {' '} - Swap - <SwapIcon /> - </NavHeader> - )} - </> + <LogoCtn> + {process.env + .REACT_APP_BUILD_ENV === + 'extension' ? ( + <ExtensionHeader + path={location.pathname} + /> + ) : ( + <CashtabLogo + src={Cashtab} + alt="cashtab" + /> + )} + + {location.pathname === + '/airdrop' && ( + <NavHeader> + Airdrop + <AirdropIcon /> + </NavHeader> )} + {location.pathname === + '/backup' && ( + <NavHeader> + Wallet Backup + <WalletIcon /> + </NavHeader> + )} + {location.pathname === + '/nfts' && ( + <NavHeader> + Listed NFTs + <NftIcon /> + </NavHeader> + )} + {location.pathname === + '/agora' && ( + <NavHeader> + Agora + <DogeIcon /> + </NavHeader> + )} + {location.pathname === + '/contacts' && ( + <NavHeader> + Contacts + <ContactsIcon /> + </NavHeader> + )} + {location.pathname === + '/wallets' && ( + <NavHeader> + Wallets + <BankIcon /> + </NavHeader> + )} + {location.pathname === + '/configure' && ( + <NavHeader> + Settings + <SettingsIcon /> + </NavHeader> + )} + {location.pathname === + '/signverifymsg' && ( + <NavHeader> + {' '} + Sign & Verify Msg + <ThemedSignAndVerifyMsg /> + </NavHeader> + )} + {location.pathname === + '/rewards' && ( + <NavHeader> + {' '} + Rewards + <RewardIcon /> + </NavHeader> + )} + {process.env + .REACT_APP_BUILD_ENV !== + 'extension' && + process.env + .REACT_APP_TESTNET !== + 'true' && ( + <> + {location.pathname === + '/swap' && ( + <NavHeader> + {' '} + Swap + <SwapIcon /> + </NavHeader> + )} + </> + )} + </LogoCtn> {process.env.REACT_APP_BUILD_ENV !== 'extension' && ( <> @@ -286,25 +261,23 @@ )} </> )} + <WalletLabel + wallets={wallets} + updateCashtabState={ + updateCashtabState + } + userLocale={navigator.language} + ></WalletLabel> </HeaderCtn> - <WalletLabel - wallets={wallets} - settings={settings} - updateCashtabState={ - updateCashtabState - } - minified={minifiedMenu} - userLocale={navigator.language} - ></WalletLabel> - <BalanceHeaderContainer - title="Wallet Info" - minified={minifiedMenu} - > + <BalanceHeaderContainer title="Wallet Info"> <BalanceHeader balanceSats={balanceSats} settings={settings} fiatPrice={fiatPrice} userLocale={navigator.language} + updateCashtabState={ + updateCashtabState + } /> </BalanceHeaderContainer> <ScreenWrapper> diff --git a/cashtab/src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js b/cashtab/src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js --- a/cashtab/src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js +++ b/cashtab/src/components/App/fixtures/__tests__/CashtabTestWrapper.test.js @@ -90,7 +90,7 @@ ); // Wait for the balance to render - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); // Home container expect(await screen.findByTestId('tx-history')).toBeInTheDocument(); diff --git a/cashtab/src/components/App/styles.js b/cashtab/src/components/App/styles.js --- a/cashtab/src/components/App/styles.js +++ b/cashtab/src/components/App/styles.js @@ -77,6 +77,14 @@ min-height: ${props => (props.showFooter ? 'calc(100vh - 80px)' : '100vh')}; `; +export const LogoCtn = styled.div` + padding: 0 20px; + display: flex; + align-items: flex-start; + flex-shrink: 0; + flex-direction: column; +`; + export const Footer = styled.div` ${AppPositionCss} z-index: 2; @@ -260,12 +268,14 @@ export const HeaderCtn = styled.div` display: flex; - flex-direction: column; align-items: center; - justify-content: center; width: 100%; padding: 15px 0; - gap: 6px; + justify-content: space-between; + position: sticky; + top: 0; + background-color: ${props => props.theme.walletBackground}; + z-index: 99; `; export const CashtabLogo = styled.img` @@ -298,14 +308,14 @@ display: flex; justify-content: center; align-items: center; + margin-top: 4px; + font-size: 14px; width: 100%; - height: 1rem; color: ${props => props.theme.navActive}; svg { - padding: 0.2rem; fill: ${props => props.theme.navActive}; - height: 33px; - width: 30px; + height: 15px; + width: 15px; } g { fill: ${props => props.theme.navActive}; @@ -316,12 +326,11 @@ `; export const BalanceHeaderContainer = styled.div` - ${props => - props.minified - ? `background-image: linear-gradient(to bottom, ${props.theme.walletBackground}, ${props.theme.walletInfoContainer})` - : `background: ${props.theme.walletInfoContainer}`}; - padding: 12px 20px; - padding-top: 0px; + background: ${props => props.theme.walletInfoContainer}; + padding: 20px 30px; + @media (max-width: 768px) { + padding: 15px 15px; + } box-sizing: border-box; transition: all 0.5s ease-in-out; *, diff --git a/cashtab/src/components/Common/BalanceHeader.js b/cashtab/src/components/Common/BalanceHeader.js --- a/cashtab/src/components/Common/BalanceHeader.js +++ b/cashtab/src/components/Common/BalanceHeader.js @@ -11,23 +11,46 @@ import { toXec } from 'wallet'; import { CashtabLoader } from 'components/Common/Spinner'; import PropTypes from 'prop-types'; +import HideBalanceSwitch from 'components/Common/HideBalanceSwitch'; -export const BalanceXec = styled.div` +export const BalanceCtn = styled.div` + width: 100%; + display: flex; + align-items: center; + flex-direction: column; + > span { + font-size: 12px; + color: ${props => props.theme.contrast}; + } +`; + +export const BalanceXecCtn = styled.div` width: 100%; - font-size: 28px; - margin-bottom: 0px; + display: flex; + align-items: center; + justify-content: center; + margin-top: 4px; +`; + +export const BalanceXec = styled.div` + font-size: 30px; font-weight: bold; - line-height: 1.4em; + line-height: 1em; + letter-spacing: -1px; @media (max-width: 768px) { - font-size: 24px; + font-size: 26px; } color: ${props => props.balanceVisible ? 'transparent' : props.theme.contrast}; text-shadow: ${props => (props.balanceVisible ? '0 0 15px #fff' : 'none')}; + span { + font-weight: normal; + opacity: 0.5; + } `; export const BalanceFiat = styled.div` - width: 100%; - font-size: 16px; + font-size: 18px; + opacity: 0.5; @media (max-width: 768px) { font-size: 16px; } @@ -36,13 +59,14 @@ text-shadow: ${props => (props.balanceVisible ? '0 0 15px #fff' : 'none')}; `; -const EcashPrice = styled.p` - margin: 0 auto; - padding: 0; - font-size: 16px; +const EcashPrice = styled.div` + font-size: 14px; + width: 100%; overflow: hidden; text-overflow: ellipsis; - color: ${props => props.theme.lightWhite}; + color: ${props => props.theme.contrast}; + opacity: 0.5; + margin-top: 5px; `; const BalanceHeader = ({ @@ -50,6 +74,7 @@ settings = new CashtabSettings(), fiatPrice = null, userLocale = 'en-US', + updateCashtabState, }) => { // If navigator.language is undefined, default to en-US userLocale = typeof userLocale === 'undefined' ? 'en-US' : userLocale; @@ -92,13 +117,19 @@ return !renderBalanceHeader ? ( <CashtabLoader /> ) : ( - <> - <BalanceXec - title="Balance in XEC" - balanceVisible={settings.balanceVisible === false} - > - {formattedBalanceXec} {appConfig.ticker}{' '} - </BalanceXec> + <BalanceCtn> + <BalanceXecCtn> + <BalanceXec + title="Balance in XEC" + balanceVisible={settings.balanceVisible === false} + > + {formattedBalanceXec} <span>{appConfig.ticker}</span> + </BalanceXec> + <HideBalanceSwitch + settings={settings} + updateCashtabState={updateCashtabState} + /> + </BalanceXecCtn> {renderFiatValues && ( <> <BalanceFiat @@ -117,7 +148,7 @@ </EcashPrice> </> )} - </> + </BalanceCtn> ); }; @@ -135,6 +166,7 @@ ]), fiatPrice: PropTypes.number, userLocale: PropTypes.string, + updateCashtabState: PropTypes.func, }; export default BalanceHeader; diff --git a/cashtab/src/components/Common/HideBalanceSwitch.js b/cashtab/src/components/Common/HideBalanceSwitch.js --- a/cashtab/src/components/Common/HideBalanceSwitch.js +++ b/cashtab/src/components/Common/HideBalanceSwitch.js @@ -3,30 +3,39 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. import React from 'react'; +import styled from 'styled-components'; import Eye from 'assets/eye.png'; import EyeInvisible from 'assets/eye-invisible.png'; import PropTypes from 'prop-types'; -import CashtabSwitch from 'components/Common/Switch'; + +export const ImageCtn = styled.div` + width: 18px; + height: 18px; + display: flex; + align-items: center; + cursor: pointer; + margin-left: 7px; + opacity: 0.5; + img { + width: 100%; + } + :hover { + opacity: 1; + } +`; const HideBalanceSwitch = ({ settings, updateCashtabState }) => { - const handleShowHideBalance = e => { + const handleShowHideBalance = () => { // Update settings in state and localforage updateCashtabState('settings', { ...settings, - balanceVisible: e.target.checked, + balanceVisible: !settings.balanceVisible, }); }; return ( - <CashtabSwitch - name="show-hide-balance" - bgImageOn={Eye} - bgImageOff={EyeInvisible} - width={50} - small - right={30} - checked={settings.balanceVisible} - handleToggle={handleShowHideBalance} - /> + <ImageCtn onClick={() => handleShowHideBalance()} title="Hide Balance"> + <img src={settings.balanceVisible ? Eye : EyeInvisible} /> + </ImageCtn> ); }; diff --git a/cashtab/src/components/Common/WalletHeaderActions.js b/cashtab/src/components/Common/WalletHeaderActions.js --- a/cashtab/src/components/Common/WalletHeaderActions.js +++ b/cashtab/src/components/Common/WalletHeaderActions.js @@ -6,30 +6,24 @@ import PropTypes from 'prop-types'; import styled from 'styled-components'; import { CopyIconButton } from 'components/Common/Buttons'; -import HideBalanceSwitch from 'components/Common/HideBalanceSwitch'; export const WalletHideBalanceCopyAddress = styled.div` display: flex; - align-items: baseline; - gap: 6px; + align-items: center; + button { + display: flex; + align-items: center; + } svg { - height: 21px; - width: 21px; + height: 18px; + width: 18px; } `; -const WalletHeaderActions = ({ - address = '', - settings, - updateCashtabState, -}) => { +const WalletHeaderActions = ({ address = '' }) => { return ( <WalletHideBalanceCopyAddress> <CopyIconButton name={`Copy ${address}`} data={address} showToast /> - <HideBalanceSwitch - settings={settings} - updateCashtabState={updateCashtabState} - /> </WalletHideBalanceCopyAddress> ); }; diff --git a/cashtab/src/components/Common/WalletLabel.js b/cashtab/src/components/Common/WalletLabel.js --- a/cashtab/src/components/Common/WalletLabel.js +++ b/cashtab/src/components/Common/WalletLabel.js @@ -9,83 +9,62 @@ import { Event } from 'components/Common/GoogleAnalytics'; import { getTextWidth } from 'helpers'; import WalletHeaderActions from 'components/Common/WalletHeaderActions'; -import { toFormattedXec } from 'utils/formatting'; import debounce from 'lodash.debounce'; const LabelCtn = styled.div` - position: sticky; - top: 0px; - padding: 12px 20px; - ${props => !props.minified && `padding-bottom: 0px;`}; - z-index: 2; - background: ${props => props.theme.walletInfoContainer}; - display: flex; - align-items: center; - justify-content: ${props => (props.minified ? 'space-between' : 'center')}; - gap: 3%; - svg { - height: 21px; - width: 21px; - } + padding-right: 20px; width: 100%; + display: flex; + justify-content: flex-end; `; const EXTRA_WIDTH_FOR_SELECT = 32; const WalletDropdown = styled.select` - font-family: 'Poppins', 'Ubuntu', -apple-system, BlinkMacSystemFont, - 'Segoe UI', 'Roboto', 'Oxygen', 'Cantarell', 'Fira Sans', 'Droid Sans', - 'Helvetica Neue', sans-serif; + font-family: + 'Poppins', + 'Ubuntu', + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + 'Roboto', + 'Oxygen', + 'Cantarell', + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + sans-serif; width: ${props => - props.minified - ? '100%' - : `${ - getTextWidth(document, props.value, '18px Poppins') + - EXTRA_WIDTH_FOR_SELECT - }px`}; - ${props => - !props.minified && - `max-width: 90%; - @media (max-width: 450px) { - max-width: 70%; - }`}; + `${ + getTextWidth(document, props.value, '16px Poppins') + + EXTRA_WIDTH_FOR_SELECT + }px`}; + max-width: 150px; cursor: pointer; - font-size: 18px; + font-size: 16px; padding: 6px; color: ${props => props.theme.contrast}; border: none; border-radius: 9px; background-color: transparent; - transition: width 0.2s; text-overflow: ellipsis; + text-align: right; &:focus-visible { outline: none; text-decoration: underline; } + :hover { + color: ${props => props.theme.eCashBlue}; + } `; const WalletOption = styled.option` - text-align: left; background-color: ${props => props.theme.walletInfoContainer}; :hover { color: ${props => props.theme.eCashPurple}; background-color: ${props => props.theme.walletInfoContainer}; } `; -const MinfiedBalanceXec = styled.div` - width: 100%; - font-size: 16px; - margin-bottom: 0px; - font-weight: bold; - color: ${props => - props.balanceVisible ? 'transparent' : props.theme.contrast}; - text-shadow: ${props => (props.balanceVisible ? '0 0 15px #fff' : 'none')}; -`; -const WalletLabel = ({ - wallets, - settings, - updateCashtabState, - minified, - userLocale = 'en-US', -}) => { + +const WalletLabel = ({ wallets, updateCashtabState }) => { const address = wallets[0].paths.get(1899).address; const debouncedActivateNewWallet = useRef( @@ -121,9 +100,9 @@ }; return ( - <LabelCtn minified={minified}> + <LabelCtn> + <WalletHeaderActions address={address} /> <WalletDropdown - minified={minified} name="wallets" id="wallets" data-testid="wallet-select" @@ -136,18 +115,6 @@ </WalletOption> ))} </WalletDropdown> - {minified && ( - <MinfiedBalanceXec - balanceVisible={settings.balanceVisible === false} - > - {toFormattedXec(wallets[0].state.balanceSats, userLocale)} - </MinfiedBalanceXec> - )} - <WalletHeaderActions - address={address} - settings={settings} - updateCashtabState={updateCashtabState} - /> </LabelCtn> ); }; @@ -167,19 +134,7 @@ }), }), ), - settings: PropTypes.oneOfType([ - PropTypes.shape({ - fiatCurrency: PropTypes.string, - sendModal: PropTypes.bool, - autoCameraOn: PropTypes.bool, - hideMessagesFromUnknownSender: PropTypes.bool, - toggleShowHideBalance: PropTypes.bool, - }), - PropTypes.bool, - ]), updateCashtabState: PropTypes.func, - minified: PropTypes.bool, - userLocale: PropTypes.string, }; export default WalletLabel; diff --git a/cashtab/src/components/Etokens/__tests__/CreateToken.test.js b/cashtab/src/components/Etokens/__tests__/CreateToken.test.js --- a/cashtab/src/components/Etokens/__tests__/CreateToken.test.js +++ b/cashtab/src/components/Etokens/__tests__/CreateToken.test.js @@ -97,7 +97,7 @@ ); // Wait for the wallet balance to load - expect(await screen.findByText('0.00 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/0\.00.*XEC/)).toBeInTheDocument(); // We do not see the Create a Token form expect(screen.queryByText('Create Token')).not.toBeInTheDocument(); diff --git a/cashtab/src/components/Home/__tests__/Home.test.js b/cashtab/src/components/Home/__tests__/Home.test.js --- a/cashtab/src/components/Home/__tests__/Home.test.js +++ b/cashtab/src/components/Home/__tests__/Home.test.js @@ -76,7 +76,7 @@ ); // Wait for the balance to render - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); // The home screen is in the document expect(await screen.findByTestId('tx-history')).toBeInTheDocument(); diff --git a/cashtab/src/components/Nfts/__tests__/index.test.js b/cashtab/src/components/Nfts/__tests__/index.test.js --- a/cashtab/src/components/Nfts/__tests__/index.test.js +++ b/cashtab/src/components/Nfts/__tests__/index.test.js @@ -248,7 +248,7 @@ ); // Wait for the wallet to load - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); // The switch is still set to Manage Listings, so we do not see buy listings expect(toggleNftsSwitch).toHaveProperty('checked', true); diff --git a/cashtab/src/components/Send/__tests__/SendByUrlParams.test.js b/cashtab/src/components/Send/__tests__/SendByUrlParams.test.js --- a/cashtab/src/components/Send/__tests__/SendByUrlParams.test.js +++ b/cashtab/src/components/Send/__tests__/SendByUrlParams.test.js @@ -79,7 +79,7 @@ ); // Wait for balance to be loaded, as input fields are not populated until balance loads - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -103,7 +103,7 @@ expect(amountInputEl).toHaveProperty('disabled', true); // Wait for balance to be loaded - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); // No addr validation errors on load for (const addrErr of SEND_ADDRESS_VALIDATION_ERRORS) { @@ -147,7 +147,7 @@ ); // Wait for balance to be loaded - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -210,7 +210,7 @@ ); // Wait for balance to be loaded, as input fields are not populated until balance loads - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -273,7 +273,7 @@ ); // Wait for balance to be loaded, as input fields are not populated until balance loads - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -451,7 +451,7 @@ ); // Wait for balance to be loaded - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -518,7 +518,7 @@ ); // Wait for balance to be loaded - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -627,7 +627,7 @@ ); // Wait for balance to be loaded, as input fields are not populated until balance loads - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address'); const amountInputEl = screen.getByPlaceholderText('Amount'); @@ -764,7 +764,7 @@ ); // Wait for balance to be loaded - expect(await screen.findByText('9,513.12 XEC')).toBeInTheDocument(); + expect(await screen.findByText(/9,513\.12.*XEC/)).toBeInTheDocument(); const addressInputEl = screen.getByPlaceholderText('Address');