5180 fichiers 38.5 Mo 0 téléchargements 227 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / wired / WiredWallPicks.test.ts
WiredWallPicks.test.ts 1 Ko Télécharger le fichier
import { RoomObjectCategory } from '@octane/renderer';
import { describe, expect, it } from 'vitest';
import { wiredPickIdOf, wiredPickIndexOf, withoutWallPick } from './WiredWallPicks';

describe('wired wall picks', () => {
    it('picks a wall item as its negative id and a floor item as its id', () => {
        expect(wiredPickIdOf(42, RoomObjectCategory.WALL)).toBe(-42);
        expect(wiredPickIdOf(42, RoomObjectCategory.FLOOR)).toBe(42);
    });

    it('finds a wall pick in AIR form and in the form boxes stored before', () => {
        expect(wiredPickIndexOf([7, -42], 42, RoomObjectCategory.WALL)).toBe(1);
        expect(wiredPickIndexOf([7, 42], 42, RoomObjectCategory.WALL)).toBe(1);
        expect(wiredPickIndexOf([7, -42], 42, RoomObjectCategory.FLOOR)).toBe(-1);
        expect(wiredPickIndexOf([7], 42, RoomObjectCategory.WALL)).toBe(-1);
    });

    it('drops a removed wall item in either form', () => {
        expect(withoutWallPick([7, -42, 42, 9], 42)).toEqual([7, 9]);
        expect(withoutWallPick([7, 9], 42)).toEqual([7, 9]);
    });
});
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