5180 fichiers 38.5 Mo 0 téléchargements 420 vues mis à jour il y a 7 heures ui
nitro-v36-with-renderer-v36 / src / hooks / rooms / widgets / furniture / useFurnitureStackHeightWidget.rounding.test.ts
useFurnitureStackHeightWidget.rounding.test.ts 631 o Télécharger le fichier
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';

describe('stack helper height', () => {
    it('rounds the height it sends instead of truncating it', () => {
        const source = readFileSync(join(process.cwd(), 'src/hooks/rooms/widgets/furniture/useFurnitureStackHeightWidget.ts'), 'utf8');

        expect(1.15 * 100).toBeLessThan(115);
        expect(Math.round(1.15 * 100)).toBe(115);
        expect(source).toContain('setPendingHeight(Math.round(height * 100));');
        expect(source).not.toContain('setPendingHeight(height * 100);');
    });
});
15Sujets
1Dépôts
20Membres
3En 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