This commit is contained in:
@@ -3,7 +3,7 @@ import { render } from 'svelte/server';
|
||||
import { writable } from 'svelte/store';
|
||||
import ChatPanel from '../../src/lib/ui/components/ChatPanel.svelte';
|
||||
import PlayerScoreboard from '../../src/lib/ui/components/PlayerScoreboard.svelte';
|
||||
import { moderationHref } from '../../src/lib/ui/moderation.js';
|
||||
import { moderationEventDetail, moderationHref } from '../../src/lib/ui/moderation.js';
|
||||
import type { UserRole } from '../../src/lib/auth.js';
|
||||
|
||||
const currentPage = writable({
|
||||
@@ -72,3 +72,41 @@ it('does not invent a game namespace for an unscoped profile', () => {
|
||||
expect(target.searchParams.get('guid')).toBe('42');
|
||||
expect(target.searchParams.has('game')).toBe(false);
|
||||
});
|
||||
|
||||
it('presents case decisions and ownership changes as readable history while preserving staff text', () => {
|
||||
expect(
|
||||
moderationEventDetail(
|
||||
JSON.stringify({
|
||||
title: { from: 'open', to: 'constructor' },
|
||||
assignee: { from: 'open', to: 'constructor' }
|
||||
}),
|
||||
'case.updated'
|
||||
)
|
||||
).toBe('Title: open → constructor\nAssigned to: open → constructor');
|
||||
expect(
|
||||
moderationEventDetail(
|
||||
JSON.stringify({
|
||||
title: { from: 'Report', to: 'Appeal review' },
|
||||
assignee: { from: null, to: 'Moderator' },
|
||||
assigneeId: { from: null, to: 'private-internal-user-id' },
|
||||
status: { from: 'open', to: 'in_review' },
|
||||
reason: 'Reviewing additional evidence'
|
||||
}),
|
||||
'case.updated'
|
||||
)
|
||||
).toBe(
|
||||
'Title: Report → Appeal review\nAssigned to: Unassigned → Moderator\nStatus: Open → In review\nReviewing additional evidence'
|
||||
);
|
||||
expect(
|
||||
moderationEventDetail(
|
||||
JSON.stringify({ from: 'appeal_denied', reason: 'New evidence' }),
|
||||
'case.reopened'
|
||||
)
|
||||
).toBe('Previous outcome: Appeal denied\nNew evidence');
|
||||
expect(moderationEventDetail('Decision with {unusual text}', 'case.resolved')).toBe(
|
||||
'Decision with {unusual text}'
|
||||
);
|
||||
expect(
|
||||
moderationEventDetail(JSON.stringify({ count: 2, matchId: 42 }), 'case.evidence_attached')
|
||||
).toBe('2 archived chat entries attached from match #42.');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user