• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

input-output-hk / lace / 8322986573

15 Mar 2024 03:15PM UTC coverage: 53.421% (-0.4%) from 53.839%
8322986573

push

github

0d1d68
web-flow
enable multi-wallet/account + fix e2e tests (#959)

* test(extension): run e2e tests for multiwallet

* test(extension): address review comments

2291 of 5273 branches covered (43.45%)

Branch coverage included in aggregate %.

5228 of 8802 relevant lines covered (59.4%)

54.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/apps/browser-extension-wallet/src/components/MainMenu/MainHeader.tsx
1
import React from 'react';
72✔
2
import { Link, useLocation } from 'react-router-dom';
72✔
3
import styles from './MainHeader.module.scss';
72✔
4
import LaceLogoMark from '../../assets/branding/lace-logo-mark.component.svg';
72✔
5
import { useTranslation } from 'react-i18next';
72✔
6
import { walletRoutePaths } from '@routes';
72✔
7
import classNames from 'classnames';
72✔
8

9
import { DropdownMenu } from '@components/DropdownMenu';
72✔
10
import { ExpandButton } from '@components/ExpandButton';
72✔
11
import { useBackgroundServiceAPIContext } from '@providers/BackgroundServiceAPI';
72✔
12
import { BrowserViewSections } from '@lib/scripts/types';
72✔
13
import { NetworkPill } from '@components/NetworkPill';
72✔
14
import { useAnalyticsContext } from '@providers';
72✔
15
import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker';
72✔
16

17
export const MainHeader = (): React.ReactElement => {
72✔
18
  const { t } = useTranslation();
×
19
  const backgroundServices = useBackgroundServiceAPIContext();
×
20
  const location = useLocation();
×
21
  const analytics = useAnalyticsContext();
×
22

23
  const locationBrowserSection = {
×
24
    [walletRoutePaths.assets]: BrowserViewSections.HOME,
25
    [walletRoutePaths.nfts]: BrowserViewSections.NFTS,
26
    [walletRoutePaths.activity]: BrowserViewSections.TRANSACTION,
27
    [walletRoutePaths.earn]: BrowserViewSections.STAKING,
28
    [walletRoutePaths.addressBook]: BrowserViewSections.ADDRESS_BOOK,
29
    [walletRoutePaths.settings]: BrowserViewSections.SETTINGS
30
  };
31

32
  return (
×
33
    <div className={styles.header} data-testid="header-container">
34
      <div
35
        className={classNames(styles.content, {
36
          [styles.multiWallet]: process.env.USE_MULTI_WALLET === 'true'
37
        })}
38
      >
39
        {process.env.USE_MULTI_WALLET === 'true' && (
×
40
          <div className={styles.multiWalletNetworkPillBox}>
41
            <NetworkPill isPopup />
42
          </div>
43
        )}
44
        <Link
45
          className={styles.linkLogo}
46
          to={walletRoutePaths.assets}
47
          data-testid="header-logo"
48
          onClick={() => analytics.sendEventToPostHog(PostHogAction.WalletLaceClick)}
×
49
        >
50
          <LaceLogoMark className={styles.logo} />
51
          {process.env.USE_MULTI_WALLET !== 'true' && <NetworkPill />}
×
52
        </Link>
53
        <div className={styles.controls}>
54
          <ExpandButton
55
            label={t('expandPopup')}
56
            onClick={() => backgroundServices.handleOpenBrowser({ section: locationBrowserSection[location.pathname] })}
×
57
          />
58
          <DropdownMenu isPopup />
59
        </div>
60
      </div>
61
    </div>
62
  );
63
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc