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

mozilla / fx-private-relay / 3bc340e2-329f-4ed2-8700-adaaac8d78c8

15 Dec 2023 06:50PM CUT coverage: 73.514% (-0.1%) from 73.614%
3bc340e2-329f-4ed2-8700-adaaac8d78c8

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

29.03
/frontend/src/components/layout/topmessage/HolidayPromoBanner.tsx
1
import Link from "next/link";
7✔
2
import { useRouter } from "next/router";
7✔
3
import { useL10n } from "../../../hooks/l10n";
7✔
4
import { Localized } from "../../Localized";
7✔
5
import styles from "./HolidayPromoBanner.module.scss";
7✔
6
import { RuntimeData } from "../../../hooks/api/runtimeData";
7
import {
8
  getPeriodicalPremiumSubscribeLink,
9
  isPeriodicalPremiumAvailableInCountry,
10
} from "../../../functions/getPlan";
7✔
11
import { ProfileData } from "../../../hooks/api/profile";
12
import { event as gaEvent } from "react-ga";
7✔
13
import { useGaViewPing } from "../../../hooks/gaViewPing";
7✔
14

15
type Props = {
16
  isLoading: boolean;
17
  profile?: ProfileData;
18
  runtimeData?: RuntimeData;
19
};
20

21
export const HolidayPromoBanner = (props: Props) => {
7✔
22
  const l10n = useL10n();
×
23
  const router = useRouter();
×
24
  const coupon = "HOLIDAY20";
×
25
  const subscribeLink = isPeriodicalPremiumAvailableInCountry(props.runtimeData)
×
26
    ? getPeriodicalPremiumSubscribeLink(props.runtimeData, "yearly")
27
    : null;
28
  const todaysDate = new Date();
×
29
  const expiryDate = new Date("December 31, 2023");
×
30
  const isPastExpiry = todaysDate > expiryDate;
×
31
  const gaHolidayBannerViewPing = useGaViewPing({
×
32
    category: "Holiday Promotion Banner 2023",
33
    label: "holiday-promo-banner-view",
34
  });
35
  const gaHolidayBannerBtnPing = () => {
×
36
    gaEvent({
×
37
      category: "Holiday Promotion Banner 2023",
38
      action: "Engage",
39
      label: "holiday-promo-banner-get-one-year-btn",
40
    });
41
  };
42

43
  if (
×
44
    props.isLoading ||
×
45
    !subscribeLink ||
46
    (props.profile && router.pathname !== "/premium") ||
47
    isPastExpiry
48
  ) {
49
    return null;
×
50
  }
51

52
  const utmParams =
53
    "&utm_source=fx-relay&utm_medium=banner&utm_content=holiday-promo-banner-cta&utm_campaign=relay-holiday-promo-2023";
×
54
  const subscriberLinkWithCoupon = `${subscribeLink}&coupon=${coupon}${utmParams}`;
×
55

56
  return (
57
    <aside className={styles.wrapper}>
58
      <div className={styles["left-promo-container"]}>
59
        <div className={styles["promo-container"]}>
60
          <p className={styles["promo-text"]}>
61
            {l10n.getString("holiday-promo-banner-protect-inbox")}
62
          </p>
63
          <p className={styles["promo-text-bolded"]}>
64
            {l10n.getString("holiday-promo-banner-code-desc")}
65
          </p>
66
        </div>
67
        <div className={styles["promo-container"]}>
68
          <Localized
69
            id="holiday-promo-banner-code-usage"
70
            vars={{ couponCode: coupon }}
71
            elems={{
72
              coupon: <span className={styles["promo-text-bolded"]} />,
73
            }}
74
          >
75
            <p className={styles["promo-text"]} />
76
          </Localized>
77
        </div>
78
      </div>
79
      <div className={styles["promo-container"]}>
80
        <Link
81
          ref={gaHolidayBannerViewPing}
82
          onClick={gaHolidayBannerBtnPing}
83
          href={subscriberLinkWithCoupon}
84
          className={styles["cta-button"]}
85
        >
86
          {l10n.getString("holiday-promo-banner-cta-button")}
87
        </Link>
88
        <small className={styles["promo-code-expiry"]}>
89
          {l10n.getString("holiday-promo-banner-promo-expiry")}
90
        </small>
91
      </div>
92
    </aside>
93
  );
94
};
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