mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
feat(ui): redesign the dashboard as a package checkpoint
Add overview, packages with quick view, package detail tabs, a merged security page, insights, system and restyled bypasses. Old vulnerable and blocked routes redirect to the matching security tab.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { verdictOf, VERDICT_LABELS } from './verdict'
|
||||
|
||||
describe('verdictOf', () => {
|
||||
it.each([
|
||||
['the server verdict when present', { scanned: true, status: 'vulnerable', verdict: 'bypassed', isBlocked: false }, 'bypassed'],
|
||||
['held for a blocked package from an older server', { scanned: true, status: 'vulnerable', isBlocked: true }, 'held'],
|
||||
['cleared for a scanned package from an older server', { scanned: true, status: 'clean' }, 'cleared'],
|
||||
['pending for an unscanned package', { scanned: false, status: 'pending' }, 'pending'],
|
||||
] as const)('%s', (_name, vulnerabilities, want) => {
|
||||
expect(verdictOf({ vulnerabilities: { ...vulnerabilities } })).toBe(want)
|
||||
})
|
||||
|
||||
it('is unscanned when the server sends no scan block, as with scanning off', () => {
|
||||
expect(verdictOf({})).toBe('unscanned')
|
||||
})
|
||||
})
|
||||
|
||||
describe('VERDICT_LABELS', () => {
|
||||
it('uses the checkpoint vocabulary', () => {
|
||||
expect(VERDICT_LABELS).toMatchObject({ cleared: 'Cleared', held: 'Held', bypassed: 'Bypassed', pending: 'Awaiting scan' })
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user