Skip to content

Commit

Permalink
Merge branch 'develop' into bring-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
yushih committed Jan 8, 2025
2 parents eb3c7a1 + b6f95fc commit 33b5a44
Show file tree
Hide file tree
Showing 419 changed files with 2,444 additions and 12,313 deletions.
4 changes: 2 additions & 2 deletions packages/e2e-tests/pages/walletCommonBase.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class WalletCommonBase extends BasePage {
this.walletBalanceTextLocator,
async () => {
const rawBalanceText = await this.getText(this.walletBalanceTextLocator);
const balanceStr = rawBalanceText.split(' ')[0];
const balanceStr = rawBalanceText.split(' ')[0].trim();
return balanceStr === balanceReplacer;
}
);
Expand All @@ -335,7 +335,7 @@ class WalletCommonBase extends BasePage {
this.walletFiatBalanceTextLocator,
async () => {
const rawFiatBalanceText = await this.getText(this.walletFiatBalanceTextLocator);
const fiatBalanceStr = rawFiatBalanceText.split(' ')[0];
const fiatBalanceStr = rawFiatBalanceText.split(' ')[0].trim();
return fiatBalanceStr === balanceReplacer;
}
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import BasePage from '../../pages/basepage.js';
import { customAfterEach } from '../../utils/customHooks.js';
import TransactionsSubTab from '../../pages/wallet/walletTab/walletTransactions.page.js';
import ReceiveSubTab from '../../pages/wallet/walletTab/receiveSubTab.page.js';
import BasePage from '../pages/basepage.js';
import { customAfterEach } from '../utils/customHooks.js';
import TransactionsSubTab from '../pages/wallet/walletTab/walletTransactions.page.js';
import ReceiveSubTab from '../pages/wallet/walletTab/receiveSubTab.page.js';
import { expect } from 'chai';
import { getTestLogger } from '../../utils/utils.js';
import { oneMinute } from '../../helpers/timeConstants.js';
import driversPoolsManager from '../../utils/driversPool.js';
import { prepareWallet } from '../../helpers/restoreWalletHelper.js';
import { testWallet1 } from '../../utils/testWallets.js';
import { getTestLogger } from '../utils/utils.js';
import { oneMinute } from '../helpers/timeConstants.js';
import driversPoolsManager from '../utils/driversPool.js';
import { prepareWallet } from '../helpers/restoreWalletHelper.js';
import { testWallet1 } from '../utils/testWallets.js';

// Issue https://emurgo.atlassian.net/browse/YOEXT-1218
describe('Hide and show balance', function () {
this.timeout(2 * oneMinute);
let webdriver = null;
let logger = null;

before(async function () {
webdriver = await driversPoolsManager.getDriverFromPool();
logger = getTestLogger(this.test.parent.title);
webdriver = await driversPoolsManager.getDriverFromPool();
await prepareWallet(webdriver, logger, 'testWallet1', this);
});
// check the default state. The balance should be displayed
Expand Down Expand Up @@ -57,9 +56,6 @@ describe('Hide and show balance', function () {
await receivePage.selectBaseExtHasBalanceAddrs();
const balanceExtAddrHidden = await receivePage.allAddressesBalancesHidden();
expect(balanceExtAddrHidden, 'Balances of external addresses are not hidden').to.be.true;
await receivePage.selectBaseInterHasBalanceAddrs();
const balanceInterAddrHidden = await receivePage.allAddressesBalancesHidden();
expect(balanceInterAddrHidden, 'Balances of internal addresses are not hidden').to.be.true;
});
// add checking Staking page when testnetwork is added
// click show balance
Expand Down Expand Up @@ -96,9 +92,6 @@ describe('Hide and show balance', function () {
await receivePage.selectBaseExtHasBalanceAddrs();
const balanceExtAddrHidden = await receivePage.allAddressesBalancesHidden();
expect(balanceExtAddrHidden, 'Balances of external addresses are hidden').to.be.false;
await receivePage.selectBaseInterHasBalanceAddrs();
const balanceInterAddrHidden = await receivePage.allAddressesBalancesHidden();
expect(balanceInterAddrHidden, 'Balances of internal addresses are hidden').to.be.false;
});
// add checking Staking page when testnetwork is added

Expand Down
36 changes: 14 additions & 22 deletions packages/yoroi-extension/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type { Node } from 'react';
import type { RouterHistory } from 'react-router-dom';
import type { StoresMap } from './stores';
import type { ActionsMap } from './actions';
import { Component } from 'react';
import { observer } from 'mobx-react';
import { Router } from 'react-router-dom';
Expand All @@ -11,11 +10,10 @@ import { observable, autorun, runInAction } from 'mobx';
import { Routes } from './Routes';
import { locales, translations } from './i18n/translations';
import { Logger } from './utils/logging';
import { LayoutProvider } from './styles/context/layout';
import { ColorModeProvider } from './styles/context/mode';
import { CssBaseline } from '@mui/material';
import { globalStyles } from './styles/globalStyles';
import { changeToplevelTheme, MuiThemes, THEMES } from './styles/themes';
import { changeToplevelTheme, MuiThemes } from './styles/themes';
import ThemeManager from './ThemeManager';
import environment from './environment';
import MaintenancePage from './containers/MaintenancePage';
Expand All @@ -27,7 +25,6 @@ addLocaleData(locales);

type Props = {|
+stores: StoresMap,
+actions: ActionsMap,
+history: RouterHistory,
|};
type State = {|
Expand Down Expand Up @@ -82,44 +79,39 @@ class App extends Component<Props, State> {
'--default-font': !environment.isProduction() ? 'wingdings' : 'Times New Roman',
};

const currentTheme = stores.profile.currentTheme || THEMES.YOROI_BASE;

const currentTheme = stores.profile.currentTheme;
changeToplevelTheme(currentTheme);

const muiTheme = MuiThemes[currentTheme];

Logger.debug(`[yoroi] themes changed`);

return (
<div style={{ height: '100%' }}>
<LayoutProvider layout={currentTheme}>
<ColorModeProvider currentTheme={currentTheme}>
<CssBaseline />
{globalStyles(muiTheme)}
<ThemeManager cssVariables={themeVars} />
{/* Automatically pass a theme prop to all components in this subtree. */}
<IntlProvider {...{ locale, key: locale, messages: mergedMessages }}>
{this.getContent()}
</IntlProvider>
</ColorModeProvider>
</LayoutProvider>
<ColorModeProvider>
<CssBaseline />
{globalStyles(muiTheme)}
<ThemeManager cssVariables={themeVars} />
{/* Automatically pass a theme prop to all components in this subtree. */}
<IntlProvider {...{ locale, key: locale, messages: mergedMessages }}>
{this.getContent()}
</IntlProvider>
</ColorModeProvider>
</div>
);
}

getContent: void => ?Node = () => {
const { stores, actions, history } = this.props;
const { stores, history } = this.props;
if (this.state.crashed === true) {
return <CrashPage />;
}
if (stores.serverConnectionStore.isMaintenance) {
return <MaintenancePage stores={stores} actions={actions} />;
return <MaintenancePage stores={stores} />;
}
return (
<Router history={history}>
<div style={{ height: '100%' }}>
<Support />
{Routes(stores, actions)}
{Routes(stores)}
</div>
</Router>
);
Expand Down
Loading

0 comments on commit 33b5a44

Please sign in to comment.