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

mozilla / fx-private-relay / 63ad679c-7c70-4935-8fd6-bc0176e80b72

15 Dec 2023 07:08PM CUT coverage: 73.514%. Remained the same
63ad679c-7c70-4935-8fd6-bc0176e80b72

push

circleci

jwhitlock
Use branch database with production tests

Previously, migrations tests were run with production code, branch
requirements, and branch migrations. Now they run with production
requirements, so that third-party migrations are tested as well.

This uses pytest --reuse-db to create a test database with the branch's
migrations, and then a pip install with the production code. This more
closely emulates the mixed environment during a deploy.

1962 of 2913 branches covered (0.0%)

Branch coverage included in aggregate %.

6273 of 8289 relevant lines covered (75.68%)

19.91 hits per line

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

0.0
/frontend/src/components/landing/DemoPhone.tsx
1
import Image, { StaticImageData } from "next/image";
×
2
import styles from "./DemoPhone.module.scss";
×
3
import BgImage from "./images/hero-image-bg.svg";
×
4
import PremiumScreenshot from "./images/hero-image-premium.svg";
×
5
import PremiumScreenshotFr from "./images/hero-image-premium-fr.svg";
×
6
import PremiumScreenshotDe from "./images/hero-image-premium-de.svg";
×
7
import NoPremiumScreenshot from "./images/hero-image-nopremium.svg";
×
8
import FgImage from "./images/hero-image-fg.svg";
×
9
import FgImageDe from "./images/hero-image-fg-de.svg";
×
10
import FgImageFr from "./images/hero-image-fg-fr.svg";
×
11
import { getLocale } from "../../functions/getLocale";
×
12
import { useL10n } from "../../hooks/l10n";
×
13

14
export type Props = {
15
  premium?: boolean;
16
};
17

18
/**
19
 * Image of a phone showing the Relay interface, either the Premium or regular UI as desired.
20
 */
21

22
export const DemoPhone = (props: Props) => {
×
23
  const l10n = useL10n();
×
24
  const lang = getLocale(l10n).split("-")[0] ?? "en";
×
25

26
  const getScreenshotImage = (
×
27
    isPremium: boolean,
28
    lang: string,
29
  ): StaticImageData => {
30
    if (lang === "fr") {
×
31
      return PremiumScreenshotFr;
×
32
    }
33
    if (lang === "de") {
×
34
      return PremiumScreenshotDe;
×
35
    }
36
    // If Premium is not availabe in the country,
37
    // show no premium demo phone state
38
    if (!isPremium) {
×
39
      return NoPremiumScreenshot;
×
40
    }
41
    return PremiumScreenshot;
×
42
  };
43

44
  const getForegroundImage = (lang: string): StaticImageData => {
×
45
    if (lang === "fr") {
×
46
      return FgImageFr;
×
47
    }
48
    if (lang === "de") {
×
49
      return FgImageDe;
×
50
    }
51
    return FgImage;
×
52
  };
53

54
  return (
55
    <div className={styles.container}>
56
      <Image src={BgImage} alt="" className={styles.background} />
57

58
      <Image
59
        src={getScreenshotImage(props.premium ?? false, lang)}
×
60
        className={styles.phone}
61
        alt=""
62
      />
63
      <Image
64
        src={getForegroundImage(lang)}
65
        alt=""
66
        className={styles.foreground}
67
      />
68
    </div>
69
  );
70
};
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