Files
peardock/test/feedback.test.js
T
snxraven 1b99224f16
CI / test (push) Successful in 9m56s
Improve deploy errors and use bottom job tray as sole feedback.
Map Docker deploy failures to actionable how-to-fix messages, keep full
detail through RPC sanitization, and stop top-center toasts from doubling
the live job tray so operators only see one notification per action.
2026-07-10 22:40:13 -04:00

23 lines
658 B
JavaScript

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()))
})