mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
19 lines
675 B
TypeScript
19 lines
675 B
TypeScript
import type { ServerConfigDto } from '@immich/sdk';
|
|
import { asUrl } from '$lib/services/shared-link.service';
|
|
import { sharedLinkFactory } from '@test-data/factories/shared-link-factory';
|
|
|
|
vi.mock(import('$lib/managers/server-config-manager.svelte'), () => ({
|
|
serverConfigManager: {
|
|
value: { externalDomain: 'http://localhost:2283' } as ServerConfigDto,
|
|
init: vi.fn(),
|
|
loadServerConfig: vi.fn(),
|
|
},
|
|
}));
|
|
|
|
describe('SharedLinkService', () => {
|
|
describe('asUrl', () => {
|
|
it('should properly encode characters in slug', () => {
|
|
expect(asUrl(sharedLinkFactory.build({ slug: 'foo/bar' }))).toBe('http://localhost:2283/s/foo%2Fbar');
|
|
});
|
|
});
|
|
});
|