5180 fichiers 38.5 Mo 0 téléchargements 343 vues mis à jour il y a 7 heures ui
nitro-v36-with-renderer-v36 / src / components / catalog / admin / studio / CatalogStudioCommandCenter.test.ts
CatalogStudioCommandCenter.test.ts 1.6 Ko Télécharger le fichier
import { describe, expect, it } from 'vitest';
import * as CommandCenter from './CatalogStudioCommandCenter';

const { getCatalogStudioCommandState, getCatalogStudioWorkspaceTabs } = CommandCenter;

describe('Catalog Manager command center state', () => {
    it('reports live problems without a publication state', () => {
        const state = getCatalogStudioCommandState({
            sessionReady: true,
            validationCurrent: false,
            validationIssueCount: 0,
            loading: false
        });

        expect(state.phase).toBe('ready');
        expect(state.canValidate).toBe(true);
        expect('canPublish' in state).toBe(false);
        expect('pendingLabel' in state).toBe(false);
    });

    it('marks the live catalog as needing repair when validation found issues', () => {
        const state = getCatalogStudioCommandState({
            sessionReady: true,
            validationCurrent: true,
            validationIssueCount: 4,
            loading: false
        });

        expect(state.phase).toBe('blocked');
        expect(state.validationLabel).toBe('4 live problems');
    });

    it('shows a neutral loading state while the first session is opening', () => {
        const state = getCatalogStudioCommandState({
            sessionReady: false,
            validationCurrent: false,
            validationIssueCount: 0,
            loading: true
        });

        expect(state.phase).toBe('loading');
        expect(state.canValidate).toBe(false);
    });

    it('exposes only the three essential workspace areas', () => {
        expect(getCatalogStudioWorkspaceTabs()).toEqual([ 'catalog', 'sql', 'history' ]);
    });
});
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