5180 fichiers 38.5 Mo 0 téléchargements 259 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / css / friends / FriendsView.friend-bar-exit.test.ts
FriendsView.friend-bar-exit.test.ts 1.4 Ko Télécharger le fichier
/* @vitest-environment jsdom */

import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import postcss from 'postcss';
import postcssNested from 'postcss-nested';
import { beforeAll, describe, expect, it } from 'vitest';

const source = readFileSync(join(process.cwd(), 'src/css/friends/FriendsView.css'), 'utf8');

beforeAll(async () => {
    const result = await postcss([postcssNested]).process(source, { from: undefined });
    const relevantRules: string[] = [];

    result.root.walkRules((rule) => {
        if (rule.selector.includes('.friend-bar-actions')) relevantRules.push(rule.toString());
    });

    const style = document.createElement('style');

    style.textContent = relevantRules.join('\n');
    document.head.appendChild(style);
});

describe('friend bar closing panel', () => {
    it('hides the retained exit frame as soon as the friend tab is deselected', () => {
        const bar = document.createElement('div');
        const friend = document.createElement('div');
        const actions = document.createElement('div');

        bar.className = 'friend-bar';
        friend.className = 'friend-bar-friend';
        actions.className = 'friend-bar-actions';
        friend.appendChild(actions);
        bar.appendChild(friend);
        document.body.appendChild(bar);

        expect(getComputedStyle(actions).display).toBe('none');
    });
});
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