5180 fichiers 38.5 Mo 0 téléchargements 275 vues mis à jour il y a 6 heures ui
nitro-v36-with-renderer-v36 / src / api / room / widgets / applyUserChatPreferences.test.ts
applyUserChatPreferences.test.ts 675 o Télécharger le fichier
import { describe, expect, it } from 'vitest';
import { applyUserChatPreferences } from './applyUserChatPreferences';

const room = { mode: 0, weight: 0, speed: 2, distance: 50, protection: 1 };

describe('applyUserChatPreferences', () => {
    it('keeps the room settings when the user left both on normal', () => {
        expect(applyUserChatPreferences(room, 1, 1)).toBe(room);
    });

    it('uses the user width and speed they picked', () => {
        expect(applyUserChatPreferences(room, 2, 0)).toEqual({ ...room, weight: 2, speed: 0 });
    });

    it('ignores unknown values', () => {
        expect(applyUserChatPreferences(room, 7, -1)).toBe(room);
    });
});
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser