test(video): update gallery accept selector + complete fileService mocks

The gallery upload input now accepts image/*,video/* — update the two JourneyDetailPage selectors that matched the old value. The files/journey e2e suites mock fileService and were missing the new MAX_VIDEO_SIZE / isVideoExtension / isVideoMime exports, which broke module load.
This commit is contained in:
Maurice
2026-06-30 12:00:46 +02:00
committed by Maurice
parent 20c1858b23
commit 4af35b162e
3 changed files with 10 additions and 4 deletions
+2 -2
View File
@@ -1813,7 +1813,7 @@ describe('JourneyDetailPage', () => {
expect(uploadBtn).toBeTruthy();
// Verify the hidden file input exists in the gallery view
const fileInput = document.querySelector('input[type="file"][accept="image/*"]') as HTMLInputElement;
const fileInput = document.querySelector('input[type="file"][accept="image/*,video/*"]') as HTMLInputElement;
expect(fileInput).toBeTruthy();
});
});
@@ -3314,7 +3314,7 @@ describe('JourneyDetailPage', () => {
});
// Find the hidden file input in the gallery view
const fileInput = document.querySelector('input[type="file"][accept="image/*"][multiple]') as HTMLInputElement;
const fileInput = document.querySelector('input[type="file"][accept="image/*,video/*"][multiple]') as HTMLInputElement;
expect(fileInput).toBeTruthy();
// Simulate file selection
+2 -1
View File
@@ -31,7 +31,8 @@ vi.mock('../../src/services/permissions', () => ({ checkPermission }));
const { fileSvc } = vi.hoisted(() => ({
fileSvc: {
MAX_FILE_SIZE: 50 * 1024 * 1024, BLOCKED_EXTENSIONS: ['.exe', '.svg'], filesDir: '/tmp/files', getAllowedExtensions: () => '*',
MAX_FILE_SIZE: 50 * 1024 * 1024, MAX_VIDEO_SIZE: 500 * 1024 * 1024, BLOCKED_EXTENSIONS: ['.exe', '.svg'], filesDir: '/tmp/files', getAllowedExtensions: () => '*',
isVideoExtension: (ext: string) => ['mp4', 'm4v', 'webm', 'mov'].includes(String(ext).toLowerCase().replace(/^\./, '')), isVideoMime: (m?: string) => !!m && m.startsWith('video/'),
verifyTripAccess: vi.fn(), resolveFilePath: vi.fn(), authenticateDownload: vi.fn(),
listFiles: vi.fn(), getFileById: vi.fn(), getDeletedFile: vi.fn(), createFile: vi.fn(), updateFile: vi.fn(),
toggleStarred: vi.fn(), softDeleteFile: vi.fn(), restoreFile: vi.fn(), permanentDeleteFile: vi.fn(),
+6 -1
View File
@@ -26,7 +26,12 @@ vi.mock('../../src/db/database', () => ({ db, closeDb: () => {}, reinitialize: (
const { isAddonEnabled } = vi.hoisted(() => ({ isAddonEnabled: vi.fn(() => true) }));
vi.mock('../../src/services/adminService', () => ({ isAddonEnabled }));
vi.mock('../../src/services/fileService', () => ({ getAllowedExtensions: () => '*' }));
vi.mock('../../src/services/fileService', () => ({
getAllowedExtensions: () => '*',
MAX_VIDEO_SIZE: 500 * 1024 * 1024,
isVideoExtension: (ext: string) => ['mp4', 'm4v', 'webm', 'mov'].includes(String(ext).toLowerCase().replace(/^\./, '')),
isVideoMime: (m?: string) => !!m && m.startsWith('video/'),
}));
vi.mock('../../src/services/memories/immichService', () => ({ uploadToImmich: vi.fn(), streamImmichAsset: vi.fn() }));
vi.mock('../../src/services/memories/photoResolverService', () => ({ streamPhoto: vi.fn() }));