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:
@@ -549,14 +549,14 @@ describe('AgentTypeForm', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Null Model Params Handling', () => {
|
||||
it('handles null model_params gracefully', () => {
|
||||
const agentTypeWithNullParams: AgentTypeResponse = {
|
||||
describe('Empty Model Params Handling', () => {
|
||||
it('handles empty model_params gracefully', () => {
|
||||
const agentTypeWithEmptyParams: AgentTypeResponse = {
|
||||
...mockAgentType,
|
||||
model_params: null,
|
||||
model_params: {},
|
||||
};
|
||||
|
||||
render(<AgentTypeForm {...defaultProps} agentType={agentTypeWithNullParams} />);
|
||||
render(<AgentTypeForm {...defaultProps} agentType={agentTypeWithEmptyParams} />);
|
||||
|
||||
// Should render without errors
|
||||
expect(screen.getByText('Edit Agent Type')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user