fix: custom-url ssr (#20704)

This commit is contained in:
Jason Rasmussen 2025-08-05 17:29:01 -04:00 committed by GitHub
parent d430b869ac
commit a5760129f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 11 deletions

View file

@ -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 &amp; videos" />`,
);
});
});
describe('GET /shared-links', () => {
it('should require authentication', async () => {
const { status, body } = await request(app).get('/shared-links');