5180 fichiers 38.5 Mo 0 téléchargements 221 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / css / avatar-editor / AvatarEditorAirText.test.ts
AvatarEditorAirText.test.ts 1.8 Ko Télécharger le fichier
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { describe, expect, it } from 'vitest';

const css = readFileSync(join(process.cwd(), 'src/css/avatar-editor/AvatarEditorView.css'), 'utf8');
const rule = (selector: string) => css.match(new RegExp(`(?:^|\\}|\\*/)\\s*${selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*\\{([^}]+)\\}`))?.[1] ?? '';

describe('avatar editor effects texts (avatarEditorContent)', () => {
    it('sets the effect name, time left and save hint in 12 px #666666', () => {
        expect(rule('.octane-avatar-editor-effects-params')).toContain('color: #666666');
        expect(rule('.octane-avatar-editor-effects-params')).toContain('font-size: 12px');
        expect(rule('.octane-avatar-editor-effect-time')).toContain('font-size: 12px');
    });

    it('draws get_more_button on the green shiny thick skin (button_thick tinted 0x00aa00), 12 px bold white', () => {
        const shop = rule('.octane-avatar-editor-effects-shop');
        expect(shop).toContain('border-image-source: var(--habbo-skin-shiny-thick-green)');
        expect(shop).toContain('border-radius: 0');
        expect(shop).toContain('font-size: 12px');
        expect(shop).not.toContain('background: #00aa00');
    });

    it('keeps the save button on the grey button_thick skin', () => {
        expect(css).toMatch(/\.octane-avatar-editor \.octane-avatar-editor-save \{[^}]*border-image-source: var\(--habbo-skin-shiny-thick\) !important;/);
    });

    it('draws the boy / girl tab titles u_bold black', () => {
        expect(rule('.octane-avatar-editor .category-item.gender-category-item')).toContain('color: #000000');
        expect(rule('.octane-avatar-editor .gender-category-item > span')).toContain('color: #000000 !important');
    });
});

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