Fix demo task readiness and gate event creation
This commit is contained in:
28
resources/js/lib/__tests__/appTitle.test.ts
Normal file
28
resources/js/lib/__tests__/appTitle.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildPageTitle, getAppName } from '../appTitle';
|
||||
|
||||
describe('app title helpers', () => {
|
||||
it('falls back to Fotospiel when VITE_APP_NAME is missing', () => {
|
||||
const original = import.meta.env.VITE_APP_NAME;
|
||||
// @ts-expect-error - import.meta.env is mutable in vitest
|
||||
import.meta.env.VITE_APP_NAME = '';
|
||||
|
||||
expect(getAppName()).toBe('Fotospiel');
|
||||
expect(buildPageTitle('Demo')).toBe('Demo - Fotospiel');
|
||||
|
||||
// @ts-expect-error - restore original value
|
||||
import.meta.env.VITE_APP_NAME = original;
|
||||
});
|
||||
|
||||
it('uses the configured VITE_APP_NAME when available', () => {
|
||||
const original = import.meta.env.VITE_APP_NAME;
|
||||
// @ts-expect-error - import.meta.env is mutable in vitest
|
||||
import.meta.env.VITE_APP_NAME = 'Fotospiel App';
|
||||
|
||||
expect(getAppName()).toBe('Fotospiel App');
|
||||
expect(buildPageTitle('Demo')).toBe('Demo - Fotospiel App');
|
||||
|
||||
// @ts-expect-error - restore original value
|
||||
import.meta.env.VITE_APP_NAME = original;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user