"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const errors_1 = require("../types/errors");
const dashboard_1 = require("./dashboard");
describe('validateSelectedTabs', () => {
    // Simple mock that focuses on just the tabUuid property
    const mockTiles = [
        { tabUuid: 'tab1' },
        { tabUuid: 'tab2' },
        { tabUuid: null },
        { tabUuid: undefined },
    ];
    it('should not throw when selectedTabs is null', () => {
        expect(() => (0, dashboard_1.validateSelectedTabs)(null, mockTiles)).not.toThrow();
    });
    it('should not throw when selectedTabs is empty array', () => {
        expect(() => (0, dashboard_1.validateSelectedTabs)([], mockTiles)).not.toThrow();
    });
    it('should not throw when selectedTabs contains valid tab UUIDs', () => {
        expect(() => (0, dashboard_1.validateSelectedTabs)(['tab1'], mockTiles)).not.toThrow();
        expect(() => (0, dashboard_1.validateSelectedTabs)(['tab1', 'tab2'], mockTiles)).not.toThrow();
    });
    it('should throw ParameterError when none of selectedTabs exist in dashboard', () => {
        expect(() => (0, dashboard_1.validateSelectedTabs)(['nonexistent-tab'], mockTiles)).toThrow(errors_1.ParameterError);
        expect(() => (0, dashboard_1.validateSelectedTabs)(['tab1', 'nonexistent-tab'], mockTiles)).not.toThrow(); // Should pass because tab1 exists
    });
    it('should throw ParameterError with informative message', () => {
        expect(() => (0, dashboard_1.validateSelectedTabs)(['nonexistent-tab'], mockTiles)).toThrow('None of the selected tabs exist in the dashboard');
    });
    it('should handle tiles without tabUuid', () => {
        const tilesWithoutTabUuid = [
            { tabUuid: undefined },
            { tabUuid: null },
        ];
        expect(() => (0, dashboard_1.validateSelectedTabs)(['any-tab'], tilesWithoutTabUuid)).toThrow('None of the selected tabs exist in the dashboard');
    });
});
//# sourceMappingURL=dashboard.test.js.map