Пользователи: цвет при создании и редактировании
This commit is contained in:
@@ -79,6 +79,17 @@ const userAvatar = normalizeRestoreData({
|
||||
});
|
||||
ok('users.avatar сохраняется', userAvatar.users[0].avatar === '/uploads/avatar.jpg', userAvatar.users[0]);
|
||||
|
||||
const userColor = normalizeRestoreData({
|
||||
...base,
|
||||
users: [{ id: 1, username: 'u', password_hash: 'h', color: '#ff5733' }],
|
||||
});
|
||||
ok('users.color сохраняется', userColor.users[0].color === '#ff5733', userColor.users[0]);
|
||||
const badUserColor = normalizeRestoreData({
|
||||
...base,
|
||||
users: [{ id: 1, username: 'u', password_hash: 'h', color: 'red' }],
|
||||
});
|
||||
ok('users.color невалидный заменяется дефолтом', badUserColor.users[0].color === '#2563eb', badUserColor.users[0]);
|
||||
|
||||
const prompts = normalizeRestoreData({
|
||||
...base,
|
||||
user_settings: [{ user_id: 1, key: 'feedback_prompts', value: 'x'.repeat(20000) }],
|
||||
|
||||
Reference in New Issue
Block a user