chore: enable Gotify and Custom Webhhok notifications and improve payload validation
- Enhanced Notifications component tests to include support for Discord, Gotify, and Webhook provider types. - Updated test cases to validate the correct handling of provider type options and ensure proper payload structure during creation, preview, and testing. - Introduced new tests for Gotify token handling and ensured sensitive information is not exposed in the UI. - Refactored existing tests for clarity and maintainability, including improved assertions and error handling. - Added comprehensive coverage for payload validation scenarios, including malformed requests and security checks against SSRF and oversized payloads.
This commit is contained in:
@@ -78,14 +78,15 @@ describe('Security Notification Settings on Notifications page', () => {
|
||||
expect(document.querySelector('.fixed.inset-0')).toBeNull();
|
||||
});
|
||||
|
||||
it('keeps provider setup focused on the Discord webhook flow', async () => {
|
||||
it('defaults to Discord webhook flow while exposing supported provider modes', async () => {
|
||||
const user = userEvent.setup();
|
||||
renderPage();
|
||||
|
||||
await user.click(await screen.findByTestId('add-provider-btn'));
|
||||
|
||||
const typeSelect = screen.getByTestId('provider-type') as HTMLSelectElement;
|
||||
expect(Array.from(typeSelect.options).map((option) => option.value)).toEqual(['discord']);
|
||||
expect(Array.from(typeSelect.options).map((option) => option.value)).toEqual(['discord', 'gotify', 'webhook']);
|
||||
expect(typeSelect.value).toBe('discord');
|
||||
|
||||
const webhookInput = screen.getByTestId('provider-url') as HTMLInputElement;
|
||||
expect(webhookInput.placeholder).toContain('discord.com/api/webhooks');
|
||||
|
||||
Reference in New Issue
Block a user