import test from 'brittle' import { markFeedbackShown, wasFeedbackRecentlyShown, showAlert, } from '../libs/uiUtils.js' test('markFeedbackShown dedupes subsequent showAlert', (t) => { const msg = `unique-feedback-dedupe-${Date.now()}` markFeedbackShown('success', msg) t.ok(wasFeedbackRecentlyShown('success', msg)) // showAlert should no-op (no throw) when recently shown showAlert('success', msg) t.pass() }) test('wasFeedbackRecentlyShown is case/whitespace tolerant via key', (t) => { const base = ` Case Mix Feedback ${Date.now()} ` markFeedbackShown('danger', base) t.ok(wasFeedbackRecentlyShown('danger', base.trim())) })