Files
slp-modular-cms/frontend/src/lib/brand.test.ts
T

27 lines
917 B
TypeScript

import { describe, expect, it } from 'vitest';
import { getBrand, themeLogo } from '@/lib/brand';
describe('themeLogo', () => {
it('points at the emitted logo files under the app base path', () => {
expect(themeLogo(true, '/admin/')).toEqual({
onLight: '/admin/brand-logo-on-light.png',
onDark: '/admin/brand-logo-on-dark.png',
});
});
it('tolerates a base without trailing slash and the dev root', () => {
expect(themeLogo(true, '/admin')?.onLight).toBe('/admin/brand-logo-on-light.png');
expect(themeLogo(true, '/')?.onDark).toBe('/brand-logo-on-dark.png');
});
it('has no logo when the theme ships none', () => {
expect(themeLogo(false)).toBeNull();
});
});
describe('getBrand', () => {
it('has no logo without a theme (the default admin is unchanged)', () => {
expect(getBrand().logo).toBeNull();
});
});