test(frontend): improve test coverage and update edge case handling
- Refactor tests to handle empty `model_params` in AgentTypeForm. - Add return type annotations (`: never`) for throwing functions in ErrorBoundary tests. - Mock `useAuth` in home page tests for consistent auth state handling. - Update Header test to validate updated `/dashboard` link.
This commit is contained in:
@@ -248,7 +248,7 @@ describe('ErrorBoundary', () => {
|
||||
|
||||
describe('error without message', () => {
|
||||
it('handles error with null message gracefully', () => {
|
||||
function ThrowNullError() {
|
||||
function ThrowNullError(): never {
|
||||
const error = new Error();
|
||||
error.message = '';
|
||||
throw error;
|
||||
@@ -338,7 +338,7 @@ describe('ErrorBoundary', () => {
|
||||
|
||||
describe('edge cases', () => {
|
||||
it('handles deeply nested errors', () => {
|
||||
function DeepChild() {
|
||||
function DeepChild(): never {
|
||||
throw new Error('Deep error');
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ describe('ErrorBoundary', () => {
|
||||
});
|
||||
|
||||
it('allows nested error boundaries', () => {
|
||||
function InnerThrowing() {
|
||||
function InnerThrowing(): never {
|
||||
throw new Error('Inner error');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user