mirror of
https://github.com/immich-app/immich.git
synced 2025-02-15 19:36:04 +02:00
chore: fix tests
This commit is contained in:
parent
4d5aaf6568
commit
3bdbf04e10
@ -23,6 +23,28 @@ describe('PhotoViewer component', () => {
|
||||
beforeAll(() => {
|
||||
getAssetOriginalUrlSpy = vi.spyOn(utils, 'getAssetOriginalUrl');
|
||||
getAssetThumbnailUrlSpy = vi.spyOn(utils, 'getAssetThumbnailUrl');
|
||||
vi.stubGlobal('cast', {
|
||||
framework: {
|
||||
CastState: {
|
||||
NO_DEVICES_AVAILABLE: 'NO_DEVICES_AVAILABLE',
|
||||
},
|
||||
RemotePlayer: vi.fn().mockImplementation(() => ({})),
|
||||
RemotePlayerEventType: {
|
||||
ANY_CHANGE: 'anyChanged',
|
||||
},
|
||||
RemotePlayerController: vi.fn().mockImplementation(() => ({ addEventListener: vi.fn() })),
|
||||
CastContext: {
|
||||
getInstance: vi.fn().mockImplementation(() => ({ setOptions: vi.fn(), addEventListener: vi.fn() })),
|
||||
},
|
||||
CastContextEventType: {
|
||||
SESSION_STATE_CHANGED: 'sessionstatechanged',
|
||||
CAST_STATE_CHANGED: 'caststatechanged',
|
||||
},
|
||||
},
|
||||
});
|
||||
vi.stubGlobal('chrome', {
|
||||
cast: { media: { PlayerState: { IDLE: 'IDLE' } }, AutoJoinPolicy: { ORIGIN_SCOPED: 'origin_scoped' } },
|
||||
});
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -2,6 +2,7 @@
|
||||
import CastPlayer, { loadCastFramework } from '$lib/utils/cast-player';
|
||||
import Button from '$lib/components/elements/buttons/button.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
onMount(async () => {
|
||||
await loadCastFramework();
|
||||
CastPlayer.getInstance();
|
||||
|
@ -24,6 +24,7 @@ const config = {
|
||||
'$lib/*': 'src/lib/*',
|
||||
'@test-data': 'src/test-data',
|
||||
$i18n: '../i18n',
|
||||
'chromecast-caf-sender': './node_modules/@types/chromecast-caf-sender/index.d.ts',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -6,9 +6,6 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "es2020",
|
||||
"moduleResolution": "bundler",
|
||||
"paths": {
|
||||
"chromecast-caf-sender": ["./node_modules/@types/chromecast-caf-sender/index.d.ts"]
|
||||
},
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
|
@ -4,7 +4,6 @@ import { svelteTesting } from '@testing-library/svelte/vite';
|
||||
import path from 'node:path';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import { defineConfig } from 'vite';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
|
||||
const upstream = {
|
||||
target: process.env.IMMICH_SERVER_URL || 'http://immich-server:2283/',
|
||||
@ -20,7 +19,6 @@ export default defineConfig({
|
||||
'xmlhttprequest-ssl': './node_modules/engine.io-client/lib/xmlhttprequest.js',
|
||||
// eslint-disable-next-line unicorn/prefer-module
|
||||
'@test-data': path.resolve(__dirname, './src/test-data'),
|
||||
'chromecast-caf-sender': path.resolve(__dirname, 'node_modules/@types/chromecast-caf-sender/index.d.ts'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
@ -41,7 +39,6 @@ export default defineConfig({
|
||||
: undefined,
|
||||
enhancedImages(),
|
||||
svelteTesting(),
|
||||
tsconfigPaths(),
|
||||
],
|
||||
optimizeDeps: {
|
||||
entries: ['src/**/*.{svelte,ts,html}'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user