CI / test (push) Successful in 9m56s
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.
23 lines
658 B
JavaScript
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()))
|
|
})
|