5180 fichiers 38.5 Mo 0 téléchargements 208 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / hooks / session / usePurchasableChatStyles.test.ts
usePurchasableChatStyles.test.ts 867 o Télécharger le fichier
// @vitest-environment jsdom
import { describe, expect, it } from 'vitest';
import { applyChatStyleNotification, applyPurchasableChatStyles } from './usePurchasableChatStyles';

describe('purchasable chat styles', () => {
    it('replaces the owned list with the login list, without duplicates', () => {
        expect(applyPurchasableChatStyles([40, 41, 40])).toEqual([40, 41]);
        expect(applyPurchasableChatStyles(null)).toEqual([]);
    });

    it('adds a granted style once and removes a revoked one', () => {
        const owned = [40];

        expect(applyChatStyleNotification(owned, true, 41)).toEqual([40, 41]);
        expect(applyChatStyleNotification(owned, true, 40)).toBe(owned);
        expect(applyChatStyleNotification([40, 41], false, 40)).toEqual([41]);
        expect(applyChatStyleNotification(owned, false, 99)).toBe(owned);
    });
});
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