feat: add BlogBodySanitizer for HTML sanitization on article save
- Implemented BlogBodySanitizer to clean HTML content before saving articles, ensuring security against XSS attacks. - Added tests for BlogBodySanitizer to verify that unsafe tags and attributes are stripped from the content. - Introduced ApiLeastPrivilegeTest to ensure that unauthorized users cannot access sensitive API routes, maintaining strict access control.
This commit is contained in:
@@ -3,8 +3,8 @@ import { screen } from '@testing-library/react';
|
||||
import { renderWithProviders } from '../test/utils';
|
||||
|
||||
const navSpy = vi.fn();
|
||||
vi.mock('react-router-dom', async (orig) => ({
|
||||
...(await orig<typeof import('react-router-dom')>()),
|
||||
vi.mock('react-router', async (orig) => ({
|
||||
...(await orig<typeof import('react-router')>()),
|
||||
useNavigate: () => navSpy,
|
||||
}));
|
||||
vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
|
||||
|
||||
Reference in New Issue
Block a user