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

describe('GetBotSkillWindowPosition', () => {
    it('centres the window on the bot with its bottom on the bot head', () => {
        expect(GetBotSkillWindowPosition({ x: 400, y: 300, width: 64 }, 209, 119, 1280, 720)).toEqual({ x: 328, y: 181 });
    });

    it('keeps the whole window on screen', () => {
        expect(GetBotSkillWindowPosition({ x: 10, y: 50, width: 40 }, 278, 369, 1280, 720)).toEqual({ x: 0, y: 0 });
        expect(GetBotSkillWindowPosition({ x: 1270, y: 2000, width: 40 }, 278, 369, 1280, 720)).toEqual({ x: 1002, y: 351 });
    });

    it('centres on screen without bot bounds', () => {
        expect(GetBotSkillWindowPosition(null, 209, 119, 1280, 720)).toEqual({ x: 536, y: 301 });
    });
});
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