5180 fichiers 38.5 Mo 0 téléchargements 137 vues mis à jour il y a 4 heures ui
nitro-v36-with-renderer-v36 / src / state / earningsIndicatorStore.test.ts
earningsIndicatorStore.test.ts 1.2 Ko Télécharger le fichier
import { afterEach, describe, expect, it } from 'vitest';
import { hasClaimableEarnings, useEarningsIndicatorStore } from './earningsIndicatorStore';

describe('AIR earnings unseen indicator', () => {
    afterEach(() => useEarningsIndicatorStore.setState({ showing: false }));

    it('lights from a first status that holds a claimable reward', () => {
        expect(hasClaimableEarnings([{ enabled: true, claimable: true, rewards: [{ amount: 5 }] }])).toBe(true);
        expect(hasClaimableEarnings([{ enabled: true, claimable: false, rewards: [{ amount: 5 }] }])).toBe(false);
        expect(hasClaimableEarnings([{ enabled: false, claimable: true, rewards: [{ amount: 5 }] }])).toBe(false);
        expect(hasClaimableEarnings([{ enabled: true, claimable: true, rewards: [{ amount: 0 }] }])).toBe(false);
        expect(hasClaimableEarnings([])).toBe(false);
    });

    it('switches on and off', () => {
        useEarningsIndicatorStore.getState().setShowing(true);
        expect(useEarningsIndicatorStore.getState().showing).toBe(true);
        useEarningsIndicatorStore.getState().setShowing(false);
        expect(useEarningsIndicatorStore.getState().showing).toBe(false);
    });
});
15Sujets
1Dépôts
20Membres
7En 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