tests: Fix frontend series and vod tests.

This commit is contained in:
SergeantPanda 2026-05-30 11:28:07 -05:00
parent 72d1520400
commit 36968631a6
3 changed files with 10 additions and 2 deletions

View file

@ -7,6 +7,12 @@ import useSettingsStore from '../../store/settings';
import { copyToClipboard } from '../../utils';
// Mock stores
vi.mock('../../store/auth', () => ({
default: {
getState: () => ({ accessToken: null }),
},
}));
vi.mock('../../store/useVODStore', () => ({
default: vi.fn(),
}));

View file

@ -140,7 +140,8 @@ export const getEpisodeStreamUrl = (episode, selectedProvider, env_mode) => {
}
const token = useAuthStore.getState().accessToken;
if (token) params.set('token', token);
if (params.toString()) streamUrl += `?${params.toString()}`;
if (params.toString())
streamUrl += `?${params.toString().replace(/\+/g, '%20')}`;
if (env_mode === 'dev') {
streamUrl = `${window.location.protocol}//${window.location.hostname}:5656${streamUrl}`;

View file

@ -72,7 +72,8 @@ export const getMovieStreamUrl = (vod, selectedProvider, env_mode) => {
}
const token = useAuthStore.getState().accessToken;
if (token) params.set('token', token);
if (params.toString()) streamUrl += `?${params.toString()}`;
if (params.toString())
streamUrl += `?${params.toString().replace(/\+/g, '%20')}`;
if (env_mode === 'dev') {
streamUrl = `${window.location.protocol}//${window.location.hostname}:5656${streamUrl}`;