Some checks failed
Deploy Web Apps / deploy (push) Successful in 5m52s
Build Android APK / build-android-apk (push) Failing after 23m15s
Queue Release Build / prepare (push) Successful in 1m42s
Queue Release Build / build-linux (push) Failing after 9m33s
Queue Release Build / build-windows (push) Successful in 26m5s
Queue Release Build / finalize (push) Has been skipped
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import {
|
|
describe,
|
|
expect,
|
|
it
|
|
} from 'vitest';
|
|
|
|
import {
|
|
DESKTOP_APP_DISPLAY_NAME,
|
|
DESKTOP_EXECUTABLE_NAME,
|
|
LEGACY_APP_REGISTRY_NAMES,
|
|
isLegacyLinuxAutostartEntry,
|
|
patchLinuxAutostartDesktopEntryNameField
|
|
} from './desktop-branding.rules';
|
|
|
|
describe('desktop-branding.rules', () => {
|
|
it('exposes the Toju desktop branding constants', () => {
|
|
expect(DESKTOP_APP_DISPLAY_NAME).toBe('Toju');
|
|
expect(DESKTOP_EXECUTABLE_NAME).toBe('toju');
|
|
expect(LEGACY_APP_REGISTRY_NAMES).toContain('MetoYou');
|
|
expect(LEGACY_APP_REGISTRY_NAMES).toContain('metoyou');
|
|
});
|
|
|
|
it('treats legacy linux autostart entries as removable', () => {
|
|
expect(isLegacyLinuxAutostartEntry('metoyou.desktop', 'toju')).toBe(true);
|
|
expect(isLegacyLinuxAutostartEntry('MetoYou.desktop', 'toju')).toBe(true);
|
|
expect(isLegacyLinuxAutostartEntry('MetoYou-1.0.0-x86_64.AppImage.desktop', 'Toju-1.1.0-x86_64.AppImage')).toBe(true);
|
|
});
|
|
|
|
it('keeps the current launch entry when it already uses the Toju binary', () => {
|
|
expect(isLegacyLinuxAutostartEntry('toju.desktop', 'toju')).toBe(false);
|
|
expect(isLegacyLinuxAutostartEntry('Toju-1.1.0-x86_64.AppImage.desktop', 'Toju-1.1.0-x86_64.AppImage')).toBe(false);
|
|
});
|
|
|
|
it('rewrites the desktop entry display name to Toju', () => {
|
|
const patched = patchLinuxAutostartDesktopEntryNameField([
|
|
'[Desktop Entry]',
|
|
'Type=Application',
|
|
'Name=metoyou',
|
|
'Exec=/opt/Toju/toju --no-sandbox %U'
|
|
].join('\n'));
|
|
|
|
expect(patched).toContain('Name=Toju');
|
|
expect(patched).not.toContain('Name=metoyou');
|
|
});
|
|
});
|