mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: custom-url ssr (#20704)
This commit is contained in:
parent
d430b869ac
commit
a5760129f0
2 changed files with 36 additions and 11 deletions
|
|
@ -9,7 +9,7 @@ import {
|
|||
} from '@immich/sdk';
|
||||
import { createUserDto, uuidDto } from 'src/fixtures';
|
||||
import { errorDto } from 'src/responses';
|
||||
import { app, asBearerAuth, shareUrl, utils } from 'src/utils';
|
||||
import { app, asBearerAuth, baseUrl, shareUrl, utils } from 'src/utils';
|
||||
import request from 'supertest';
|
||||
import { beforeAll, describe, expect, it } from 'vitest';
|
||||
|
||||
|
|
@ -78,6 +78,7 @@ describe('/shared-links', () => {
|
|||
type: SharedLinkType.Album,
|
||||
albumId: metadataAlbum.id,
|
||||
showMetadata: true,
|
||||
slug: 'metadata-album',
|
||||
}),
|
||||
utils.createSharedLink(user1.accessToken, {
|
||||
type: SharedLinkType.Album,
|
||||
|
|
@ -138,6 +139,17 @@ describe('/shared-links', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('GET /s/:slug', () => {
|
||||
it('should work for slug auth', async () => {
|
||||
const resp = await request(baseUrl).get(`/s/${linkWithMetadata.slug}`);
|
||||
expect(resp.status).toBe(200);
|
||||
expect(resp.header['content-type']).toContain('text/html');
|
||||
expect(resp.text).toContain(
|
||||
`<meta name="description" content="${metadataAlbum.assets.length} shared photos & videos" />`,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('GET /shared-links', () => {
|
||||
it('should require authentication', async () => {
|
||||
const { status, body } = await request(app).get('/shared-links');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue