Skip to content

Conversation

@mshriver
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 12, 2025 22:27
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @mshriver, your pull request is larger than the review limit of 150000 diff characters

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive frontend test coverage for React components and pages, improves backend test organization by consolidating imports, and provides detailed testing documentation. The changes follow integration testing best practices with minimal mocking.

Key changes:

  • Added 11 new frontend test files covering widgets, pages, and components
  • Enhanced test utilities with new helpers and mock data factories
  • Created comprehensive testing guide documentation
  • Refactored backend tests to consolidate imports at file level
  • Added backend utility function test coverage

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/widgets/run-aggregate-apex.test.js New comprehensive tests for RunAggregateApex widget
frontend/src/widgets/result-aggregate-apex.test.js New tests for ResultAggregateApex widget
frontend/src/widgets/filter-heatmap.test.js Added 557 lines of new test coverage for cell rendering, Jenkins links, and edge cases
frontend/src/pages/result-list.test.js Updated parameter types from number to string for URL params
frontend/src/pages/login.test.js New comprehensive login page tests covering OAuth and form validation
frontend/src/pages/dashboard.test.js Added tests for dashboard selection, CRUD operations, and widget management
frontend/src/pages/admin/project-edit.test.js New tests for project editing admin page
frontend/src/components/test-history.test.js New tests for test history table component
frontend/src/components/ibutsu-header.test.js New tests for header component with project selection
frontend/src/components/filtering/result-filter.test.js Added 277 lines of tests for various filter operations
frontend/src/components/classify-failures.test.js New tests for failure classification component
frontend/src/test-utils/test-helpers.js Added new helper functions for rendering with providers and mocking HTTP responses
frontend/src/test-utils/mock-data.js Added factory functions for Jenkins runs and nested metadata
frontend/src/test-utils/constants.js Added Jenkins and nested metadata test constants
docs/source/developer-guide/frontend-testing.rst Replaced placeholder with comprehensive 569-line testing guide
backend/tests/test_*.py Multiple files refactored to consolidate imports at module level

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import IbutsuHeader from './ibutsu-header';
import { IbutsuContext } from './contexts/ibutsu-context';
import { HttpClient } from '../utilities/http';
import { createMockProject, createMockDashboard } from '../test-utils';
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import createMockDashboard.

Suggested change
import { createMockProject, createMockDashboard } from '../test-utils';
import { createMockProject } from '../test-utils';

Copilot uses AI. Check for mistakes.
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
import RunAggregateApex from './run-aggregate-apex';
import { HttpClient } from '../utilities/http';
import { createMockRunAggregatorData } from '../test-utils';
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import createMockRunAggregatorData.

Copilot uses AI. Check for mistakes.
@mshriver mshriver mentioned this pull request Dec 17, 2025
@mshriver mshriver force-pushed the frontend-test-coverage branch from 28f8b31 to 03c80d4 Compare January 6, 2026 14:49
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 14.70588% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.64%. Comparing base (0fa1ca5) to head (03c80d4).

Files with missing lines Patch % Lines
frontend/src/test-utils/test-helpers.js 0.00% 18 Missing ⚠️
frontend/src/test-utils/mock-data.js 15.38% 11 Missing ⚠️

❌ Your patch check has failed because the patch coverage (14.70%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (72.64%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #792      +/-   ##
==========================================
+ Coverage   64.81%   72.64%   +7.83%     
==========================================
  Files         157      157              
  Lines        7633     7666      +33     
  Branches      659      659              
==========================================
+ Hits         4947     5569     +622     
+ Misses       2467     1876     -591     
- Partials      219      221       +2     
Files with missing lines Coverage Δ
frontend/src/components/last-passed.js 0.00% <ø> (ø)
frontend/src/components/test-history.js 95.49% <ø> (+95.49%) ⬆️
frontend/src/test-utils/constants.js 100.00% <100.00%> (ø)
frontend/src/widgets/filter-heatmap.js 56.89% <100.00%> (-1.73%) ⬇️
frontend/src/test-utils/mock-data.js 67.39% <15.38%> (-8.37%) ⬇️
frontend/src/test-utils/test-helpers.js 0.00% <0.00%> (ø)

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fa1ca5...03c80d4. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant