import { ApiService, render } from 'src/services/api.service'; describe(ApiService.name, () => { describe('render', () => { it('should correctly render open graph tags', () => { const output = render('', { title: 'title', description: 'description', imageUrl: 'https://demo.immich.app/api/assets/123', }); expect(output).toContain(''); expect(output).toContain(''); expect(output).toContain(''); }); it('should escape html tags', () => { expect( render('', { title: "Test", description: 'description', }), ).toContain( '', ); }); it('should escape quotes', () => { expect( render('', { title: `0;url=https://example.com" http-equiv="refresh`, description: 'description', }), ).toContain(''); }); }); });