mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor(web): routes (#25313)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { OpenQueryParam } from '$lib/constants';
|
||||
import { Route } from '$lib/route';
|
||||
|
||||
describe('Route', () => {
|
||||
describe(Route.login.name, () => {
|
||||
it('should encode continue', () => {
|
||||
expect(Route.login({ continue: '/some/path?with=query', autoLaunch: 1 })).toBe(
|
||||
'/auth/login?continue=%2Fsome%2Fpath%3Fwith%3Dquery&autoLaunch=1',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe(Route.search.name, () => {
|
||||
it('should work', () => {
|
||||
expect(Route.search({})).toBe('/search');
|
||||
});
|
||||
|
||||
it('should work', () => {
|
||||
expect(Route.search({ make: undefined, model: 'Immich' })).toBe('/search?query=%7B%22model%22%3A%22Immich%22%7D');
|
||||
});
|
||||
|
||||
it('should support query parameters', () => {
|
||||
expect(Route.systemSettings({ isOpen: OpenQueryParam.OAUTH })).toBe('/admin/system-settings?isOpen=oauth');
|
||||
});
|
||||
});
|
||||
|
||||
describe(Route.systemSettings.name, () => {
|
||||
it('should work', () => {
|
||||
expect(Route.systemSettings()).toBe('/admin/system-settings');
|
||||
});
|
||||
|
||||
it('should support query parameters', () => {
|
||||
expect(Route.systemSettings({ isOpen: OpenQueryParam.OAUTH })).toBe('/admin/system-settings?isOpen=oauth');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user