From f624c8d36be0c5181004dec93230dd703caa7c04 Mon Sep 17 00:00:00 2001 From: Evie Gauthier Date: Tue, 17 Mar 2026 09:34:28 -0400 Subject: [PATCH] feat(sentry): make consent banner non-dismissable --- .../TelemetryConsentBanner.test.tsx | 18 +----------------- .../TelemetryConsentBanner.tsx | 12 +----------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/app/components/telemetry-consent/TelemetryConsentBanner.test.tsx b/src/app/components/telemetry-consent/TelemetryConsentBanner.test.tsx index 896374db..a1030889 100644 --- a/src/app/components/telemetry-consent/TelemetryConsentBanner.test.tsx +++ b/src/app/components/telemetry-consent/TelemetryConsentBanner.test.tsx @@ -52,7 +52,7 @@ describe('TelemetryConsentBanner', () => { render(); expect(screen.getByRole('button', { name: /enable/i })).toBeInTheDocument(); expect(screen.getByRole('button', { name: /no thanks/i })).toBeInTheDocument(); - expect(screen.getByRole('button', { name: /dismiss/i })).toBeInTheDocument(); + expect(screen.queryByRole('button', { name: /dismiss/i })).not.toBeInTheDocument(); }); it('includes a link to the privacy policy', () => { @@ -77,22 +77,6 @@ describe('TelemetryConsentBanner', () => { expect(window.location.reload).toHaveBeenCalledOnce(); }); - // ── dismiss (✕) action ──────────────────────────────────────────────────── - - it('dismiss button (✕) saves opted-out preference to localStorage', () => { - vi.stubEnv('VITE_SENTRY_DSN', TEST_DSN); - render(); - fireEvent.click(screen.getByRole('button', { name: /dismiss/i })); - expect(localStorage.getItem(SENTRY_KEY)).toBe('false'); - }); - - it('dismiss button does not reload the page', () => { - vi.stubEnv('VITE_SENTRY_DSN', TEST_DSN); - render(); - fireEvent.click(screen.getByRole('button', { name: /dismiss/i })); - expect(window.location.reload).not.toHaveBeenCalled(); - }); - // ── "No thanks" action ──────────────────────────────────────────────────── it('"No thanks" saves opted-out preference to localStorage', () => { diff --git a/src/app/components/telemetry-consent/TelemetryConsentBanner.tsx b/src/app/components/telemetry-consent/TelemetryConsentBanner.tsx index 337da655..5c1e90a0 100644 --- a/src/app/components/telemetry-consent/TelemetryConsentBanner.tsx +++ b/src/app/components/telemetry-consent/TelemetryConsentBanner.tsx @@ -1,5 +1,5 @@ import { useEffect, useRef, useState } from 'react'; -import { Box, Button, Icon, IconButton, Icons, Text } from 'folds'; +import { Box, Button, Icon, Icons, Text } from 'folds'; import * as css from './TelemetryConsentBanner.css'; const SENTRY_KEY = 'sable_sentry_enabled'; @@ -56,16 +56,6 @@ export function TelemetryConsentBanner() { - - -