AI Implementation feature(823): Landing Page and Login/Register Modal (#11)

This commit was merged in pull request #11.
This commit is contained in:
2026-07-21 18:34:45 +00:00
parent 8476e4a59f
commit 685a8bca84
51 changed files with 2354 additions and 226 deletions
+34
View File
@@ -0,0 +1,34 @@
import { renderMarkdownToHtml } from '../../frontend/src/app/core/services/markdown.pure';
describe('renderMarkdownToHtml', () => {
it('renders headings', () => {
expect(renderMarkdownToHtml('# Hello')).toContain('<h1>Hello</h1>');
});
it('renders bold and italic', () => {
const out = renderMarkdownToHtml('**bold** and *italic*');
expect(out).toContain('<strong>bold</strong>');
expect(out).toContain('<em>italic</em>');
});
it('renders safe links', () => {
expect(renderMarkdownToHtml('[a](https://example.com)')).toContain('href="https://example.com"');
});
it('strips <script> tags', () => {
const out = renderMarkdownToHtml('<script>alert(1)</script>safe');
expect(out).not.toContain('<script>');
expect(out).toContain('safe');
});
it('strips javascript: hrefs', () => {
const out = renderMarkdownToHtml('[click](javascript:alert(1))');
expect(out).not.toMatch(/href="javascript:/i);
});
it('handles empty/null/undefined input', () => {
expect(renderMarkdownToHtml('')).toBeDefined();
expect(renderMarkdownToHtml(null as unknown as string)).toBeDefined();
expect(renderMarkdownToHtml(undefined as unknown as string)).toBeDefined();
});
});