The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
fix: restore broken tests after prerelease workflow refactor
jubnlad27c5f6be8f
diff --git a/client/src/components/Admin/GitHubPanel.test.tsx b/client/src/components/Admin/GitHubPanel.test.tsxindex edf45fdfe..617bdd885 100644--- a/client/src/components/Admin/GitHubPanel.test.tsx+++ b/client/src/components/Admin/GitHubPanel.test.tsx@@ -133,7 +133,7 @@ describe('GitHubPanel', () => {server.use(http.get('/api/admin/github-releases', () => HttpResponse.json([r])),);- render(<GitHubPanel />);+ render(<GitHubPanel isPrerelease={true} />);await screen.findByText('v3.0.0-beta.1');expect(screen.getByText('Pre-release')).toBeInTheDocument();});diff --git a/client/src/components/Layout/Navbar.test.tsx b/client/src/components/Layout/Navbar.test.tsxindex e76f70f0f..b0f8df240 100644--- a/client/src/components/Layout/Navbar.test.tsx+++ b/client/src/components/Layout/Navbar.test.tsx@@ -16,7 +16,7 @@ beforeEach(() => {http.get('/api/auth/app-config', () => HttpResponse.json({ version: '2.9.10' })),http.get('/api/addons', () => HttpResponse.json({ addons: [] })),);- seedStore(useAuthStore, { user: buildUser({ username: 'testuser', role: 'user' }), isAuthenticated: true });+ seedStore(useAuthStore, { user: buildUser({ username: 'testuser', role: 'user' }), isAuthenticated: true, appVersion: '2.9.10' });seedStore(useSettingsStore, { settings: buildSettings() });});diff --git a/client/src/components/Vacay/VacaySettings.test.tsx b/client/src/components/Vacay/VacaySettings.test.tsxindex c2f4a5cc2..efcc310a9 100644--- a/client/src/components/Vacay/VacaySettings.test.tsx+++ b/client/src/components/Vacay/VacaySettings.test.tsx@@ -1,5 +1,5 @@import { describe, it, expect, vi, beforeEach } from 'vitest'-import { screen, waitFor } from '@testing-library/react'+import { screen, waitFor, within } from '@testing-library/react'import userEvent from '@testing-library/user-event'import { render } from '../../../tests/helpers/render'import { resetAllStores, seedStore } from '../../../tests/helpers/store'@@ -75,17 +75,7 @@ describe('VacaySettings', () => {render(<VacaySettings onClose={vi.fn()} />)// Day buttons should be visible (Mon, Tue, Wed, Thu, Fri, Sat, Sun)- // They have text from translation keys; in test env they fallback to keys or English- // Check that 7 day-selector buttons exist (they are inside the paddingLeft:36 div)- const allButtons = screen.getAllByRole('button')- // The day buttons are not toggle buttons (no inline-flex/rounded-full class)- const dayButtons = allButtons.filter(b =>- !b.className.includes('inline-flex') &&- !b.className.includes('rounded-full') &&- !b.className.includes('rounded-md') &&- !b.className.includes('rounded-xl') &&- !b.className.includes('rounded-lg')- )+ const dayButtons = within(screen.getByTestId('weekend-days')).getAllByRole('button')// There should be 7 day buttonsexpect(dayButtons.length).toBe(7)})@@ -98,14 +88,8 @@ describe('VacaySettings', () => {})render(<VacaySettings onClose={vi.fn()} />)- // When block_weekends is false, the day selector section is not rendered- // There should only be toggle buttons (4 toggles), no day buttons- const allButtons = screen.getAllByRole('button')- // None of the buttons should be day selectors (they have borderRadius:8 inline style)- const dayButtons = allButtons.filter(b =>- b.style.borderRadius === '8px' && b.style.padding === '4px 10px'- )- expect(dayButtons).toHaveLength(0)+ // When block_weekends is false, the weekend-days container is not rendered+ expect(screen.queryByTestId('weekend-days')).toBeNull()})it('FE-COMP-VACAYSETTINGS-005: clicking an active weekend day removes it', async () => {diff --git a/client/src/components/Vacay/VacaySettings.tsx b/client/src/components/Vacay/VacaySettings.tsxindex 14efe606e..124a3a1fb 100644--- a/client/src/components/Vacay/VacaySettings.tsx+++ b/client/src/components/Vacay/VacaySettings.tsx@@ -51,7 +51,7 @@ export default function VacaySettings({ onClose }: VacaySettingsProps) {{/* Weekend days selector */}{plan.block_weekends !== false && (- <div style={{ paddingLeft: 36 }}>+ <div data-testid="weekend-days" style={{ paddingLeft: 36 }}><p className="text-xs font-medium mb-2" style={{ color: 'var(--text-muted)' }}>{t('vacay.weekendDays')}</p><div className="flex flex-wrap gap-1.5">{[diff --git a/server/src/services/adminService.ts b/server/src/services/adminService.tsindex 3a5a93213..eec43ecde 100644--- a/server/src/services/adminService.ts+++ b/server/src/services/adminService.ts@@ -328,6 +328,11 @@ interface VersionInfo {const VERSION_CACHE_TTL = 5 * 60 * 1000; // 5 minuteslet _versionCache: { data: VersionInfo; expiresAt: number } | null = null;+/** Test-only: clear the in-memory version cache. */+export function __clearVersionCacheForTests(): void {+ _versionCache = null;+}+export async function checkVersion(): Promise<VersionInfo> {if (_versionCache && Date.now() < _versionCache.expiresAt) {return _versionCache.data;diff --git a/server/tests/unit/services/versionNotification.test.ts b/server/tests/unit/services/versionNotification.test.tsindex bbe1c15de..c43dba980 100644--- a/server/tests/unit/services/versionNotification.test.ts+++ b/server/tests/unit/services/versionNotification.test.ts@@ -34,7 +34,7 @@ import { createTables } from '../../../src/db/schema';import { runMigrations } from '../../../src/db/migrations';import { resetTestDb } from '../../helpers/test-db';import { createAdmin } from '../../helpers/factories';-import { checkAndNotifyVersion } from '../../../src/services/adminService';+import { checkAndNotifyVersion, __clearVersionCacheForTests } from '../../../src/services/adminService';// Helper: mock the GitHub releases/latest endpointfunction mockGitHubLatest(tagName: string, ok = true): void {@@ -63,6 +63,7 @@ beforeAll(() => {beforeEach(() => {resetTestDb(testDb);+ __clearVersionCacheForTests();vi.unstubAllGlobals();});