Files
poli0981andClaude Opus 5.5 f2a5135993 v4.4.0: admin automation, bulk remove/edit, theme icon, smooth chart tabs (#133)
Admin: add games from any list or itch.io collection (Check first, batches of 200, per-game ingest tracking from scripts/state/ingest_outcomes.json), followed collections and auto-approve run by the cron in one [auto] commit, bulk remove/edit up to 100 games in one commit, New games, Activity and Settings pages. D1 migration 0002 (applied to production before this merge). Policies (ToS, Privacy, Disclaimer, EN + VI) cover approval by the maintainer's rules; LEGAL_VERSION 2026-10-13.

Web: the theme button shows the theme in use, no dark-mode flash (pre-paint script, hash in three CSPs), Charts tabs stay mounted (no rebuilt charts or replayed animations), 300 ms entrances, scrollbar gutter on mouse devices.

Release 4.4.0 (changelog also covers #130).

[skip-discuss]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:08:33 +07:00

31 lines
1.2 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import type { CheckResult } from './api'
import { groupOf, groupResults } from './check-groups'
const r = (outcome: string, url: string | null, status: CheckResult['status'] = null): CheckResult => ({
input: url ?? 'x',
url,
outcome,
status,
})
describe('check groups', () => {
it('says what Add would do with each URL', () => {
expect(groupOf(r('queued', 'u'))).toBe('new')
expect(groupOf(r('duplicate_pending', 'u', 'pending'))).toBe('waiting')
expect(groupOf(r('duplicate_pending', 'u', 'failed'))).toBe('waiting')
expect(groupOf(r('duplicate_pending', 'u', 'queued'))).toBe('queued')
expect(groupOf(r('duplicate_catalog', 'u'))).toBe('catalog')
expect(groupOf(r('previously_deleted', 'u'))).toBe('removed')
expect(groupOf(r('rejected', 'u'))).toBe('rejected')
expect(groupOf(r('invalid_url', null))).toBe('invalid')
})
it('groups results in input order and drops repeats', () => {
const groups = groupResults([r('queued', 'a'), r('duplicate_in_request', 'a'), r('queued', 'b'), r('invalid_url', null)])
expect(groups.new).toEqual(['a', 'b'])
expect(groups.invalid).toEqual(['x'])
expect(groups.catalog).toEqual([])
})
})