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

/** Widths as the room setting names them: 0 wide, 1 normal, 2 thin. -1 means "no override". */
describe('resolveChatBubbleWidth', () => {
    it('uses the room setting when the message carries no override', () => {
        expect(resolveChatBubbleWidth(-1, 1)).toBe(1);
        expect(resolveChatBubbleWidth(undefined, 2)).toBe(2);
    });

    it('lets a wired message override the room setting', () => {
        expect(resolveChatBubbleWidth(0, 1)).toBe(0);
        expect(resolveChatBubbleWidth(2, 0)).toBe(2);
    });

    it('ignores an override that names no width', () => {
        expect(resolveChatBubbleWidth(3, 1)).toBe(1);
        expect(resolveChatBubbleWidth(-7, 0)).toBe(0);
    });
});
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