Skip to content

test(alerts): clear localStorage between anomaly banner tests - #121172

Open
JoshuaKGoldberg wants to merge 3 commits into
masterfrom
joshgoldberg/logs-936-fix-anomaly-banner-test-isolation
Open

test(alerts): clear localStorage between anomaly banner tests#121172
JoshuaKGoldberg wants to merge 3 commits into
masterfrom
joshgoldberg/logs-936-fix-anomaly-banner-test-isolation

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Aug 4, 2026

Copy link
Copy Markdown
Member

anomalyDetectionFeedbackBannersubmits anomaly detection feedback (yes) fails all but the first of its runs when run repeatedly. The banner records dismissal in localStorage keyed by incident id via useDismissable, but never clears out the key.

Fixed by clearing localStorage in beforeEach.

Follow-up to a follow-up on LOGS-936

anomalyDetectionFeedbackBanner's 'submits anomaly detection feedback (yes)'
fails 49 of 50 stressed runs. The banner records dismissal in localStorage
keyed by incident id via useDismissable, and jsdom keeps that store for the
whole file, so only the first run sees a banner to click. The sibling test
passes only because it uses a different incident id.

Clearing localStorage in beforeEach makes it repeatable, so the
it.isKnownFlake() marker comes off too.

Refs LOGS-936
@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown

LOGS-936

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants