// Account → Blocked and the Reports queue's "Hide for everyone" // (client/src/lib/userSafety.js; docs/website/USER_SAFETY.md §1, §4.1). import { test } from 'node:test' import assert from 'node:assert/strict' import { blockSubtitle, canHideForEveryone } from '../src/lib/userSafety.js' test('a game block says it is a Steam id with no account yet; an account block says Account', () => { const game = blockSubtitle({ kind: 'game', identity: { module: 'rust', kind: 'steam', label: 'Steam account', id: '76561198000000123' }, }) assert.equal(game, 'Steam account 76561198000000123, not linked to an account') assert.equal(blockSubtitle({ kind: 'account', identity: null }), 'Account') assert.match(blockSubtitle({ kind: 'account', createdAt: '2026-10-30T10:00:00Z' }), /^Account · blocked /) }) test('hide for everyone is offered on a post, a thread and a chat line, never on an upload or twice', () => { assert.equal(canHideForEveryone({ targetType: 'team_forum_post', actionedWith: null }), true) assert.equal(canHideForEveryone({ targetType: 'team_forum_thread', actionedWith: null }), true) assert.equal(canHideForEveryone({ targetType: 'rust.chat', actionedWith: null }), true) assert.equal(canHideForEveryone({ targetType: 'team_forum_upload', actionedWith: null }), false) assert.equal(canHideForEveryone({ targetType: 'rust.chat', actionedWith: 'hide' }), false) })