import { describe, expect, it } from 'vitest'; import { APP_SETTINGS, DEFAULT_CONTAINER_BY_LAYOUT } from '#app/config/settings'; import { LayoutNames } from '#app/config/types'; const layoutNames = Object.values(LayoutNames); describe('layout settings', () => { it('carries options for every layout, so any layout can read its own', () => { for (const name of layoutNames) { expect(APP_SETTINGS.layouts[name], name).toEqual({ sidebarCollapse: false, sidebarTheme: 'light', headerSticky: true, headerStickyOffset: 200 }); } }); it('gives each layout its own options object, so one layout cannot edit another', () => { const options = layoutNames.map((name) => APP_SETTINGS.layouts[name]); expect(new Set(options).size).toBe(layoutNames.length); }); }); describe('layout containers', () => { it('assigns a container width to every layout', () => { for (const name of layoutNames) { expect(DEFAULT_CONTAINER_BY_LAYOUT[name], name).toMatch(/^(fixed|fluid)$/); } }); it('gives the mega-menu layout a fluid container, since its panels span the viewport', () => { expect(DEFAULT_CONTAINER_BY_LAYOUT[LayoutNames.ADVANCE_MEGA_MENU]).toBe('fluid'); }); });