- {l10n.getString(
- "settings-alert-preferences-allow-monthly-monitor-plus-report-title",
- )}
+ {hasPremium(props.user)
+ ? l10n.getString(
+ "settings-alert-preferences-allow-monthly-monitor-plus-report-title",
+ )
+ : l10n.getString(
+ "settings-alert-preferences-allow-monthly-monitor-report-title",
+ )}
{l10n.getString(
- "settings-alert-preferences-allow-monthly-monitor-plus-report-subtitle",
+ "settings-alert-preferences-allow-monthly-monitor-report-subtitle",
)}
diff --git a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/SettingsPage.test.tsx b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/SettingsPage.test.tsx
index 89d9d21842e..2db9a5390a1 100644
--- a/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/SettingsPage.test.tsx
+++ b/src/app/(proper_react)/(redesign)/(authenticated)/user/(dashboard)/settings/SettingsPage.test.tsx
@@ -57,6 +57,7 @@ jest.mock("next/navigation", () => ({
import { SettingsView } from "./View";
import { sanitizeEmailRow } from "../../../../../../functions/server/sanitize";
import { defaultExperimentData } from "../../../../../../../telemetry/generated/nimbus/experiments";
+import { SubscriberEmailPreferencesOutput } from "../../../../../../../db/tables/subscriber_email_preferences";
const subscriberId = 7;
const mockedSerializedSubscriber: SerializedSubscriber = {
@@ -151,6 +152,19 @@ const mockedUser: Session["user"] = {
},
};
+const mockedFreeUser: Session["user"] = {
+ email: "primary@example.com",
+ subscriber: undefined,
+ fxa: {
+ subscriptions: [],
+ avatar: "",
+ avatarDefault: false,
+ locale: "en-GB",
+ metricsEnabled: false,
+ twoFactorAuthentication: false,
+ },
+};
+
const mockedSecondaryVerifiedEmail: EmailAddressRow = {
id: 1337,
email: "secondary_verified@example.com",
@@ -207,11 +221,31 @@ const mockedSubscriptionBillingAmount = {
yearly: 13.37,
monthly: 42.42,
};
+const mockedPlusSubscriberEmailPreferences: SubscriberEmailPreferencesOutput = {
+ id: 1337,
+ primary_email: "primary@example.com",
+ unsubscribe_token: "495398jfjvjfdj",
+ monthly_monitor_report_free: false,
+ monthly_monitor_report_free_at: new Date("1337-04-02T04:02:42.000Z"),
+ monthly_monitor_report: true,
+ monthly_monitor_report_at: new Date("1337-04-02T04:02:42.000Z"),
+};
+
+const mockedFreeSubscriberEmailPreferences: SubscriberEmailPreferencesOutput = {
+ id: 1337,
+ primary_email: "primary@example.com",
+ unsubscribe_token: "495398jfjvjfdj",
+ monthly_monitor_report_free: true,
+ monthly_monitor_report_free_at: new Date("1337-04-02T04:02:42.000Z"),
+ monthly_monitor_report: false,
+ monthly_monitor_report_at: new Date("1337-04-02T04:02:42.000Z"),
+};
it("passes the axe accessibility audit", async () => {
const { container } = render(