Skip to content

test(*): restore coverage the vitest migration left out - #18024

Open
damyanpetev wants to merge 2 commits into
masterfrom
dpetev/vitest-coverage-tests
Open

damyanpetev wants to merge 2 commits into
masterfrom
dpetev/vitest-coverage-tests

Conversation

@damyanpetev

Copy link
Copy Markdown
Member

Follow-up to #17790. Adds tests for paths the Vitest suite does not reach, all at 0 hits on master in Coveralls build 83159602, and fixes tests that passed without checking what they describe.

New coverage

Area Test
date-range-picker Blur without a form control, clearing while the calendar is open, minValue/maxValue (dates and ISO strings) disabling calendar dates
drag-drop Destroying the directive while it auto-scrolls the window
grid Excel-style filtering Reopening the menu after the custom filter dialog
grid advanced filtering Changing the resource strings while the dialog is open
pivot grid Changing the resource strings regenerates the date dimensions
src/public_api.spec.ts Every IGX_*_DIRECTIVES collection is non-empty, with only defined, standalone entries. An undefined entry is what a circular import leaves behind.

Tests that did not check anything

  • column-moving, Escape: the keydown never reached the moving directive's window listener because it did not bubble. The test now also asserts that the drag ghost is gone.
  • column-moving, cancel in columnMoving: the drag directive handles one pointer move per animation frame, and wait() only outlasts a frame on some machines. The test now waits a frame and asserts the drag started, then that cancelling ends it.
  • tree-grid selection, cascade after filtering: the test now waits for filteringDone after change detection, so the cascade runs on the filtered rows.

Autosize

autoSizeColumnsInView refreshes the whole grid before measuring (added in #17790). After that, a column no longer has fewer cells than there are rows, so the per-row refresh that followed never ran and is removed.

🤖 Generated with Claude Code

damyanpetev and others added 2 commits November 20, 2026 19:32
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #17790, autoSizeColumnsInView refreshes the whole grid before
measuring, so a column no longer has fewer cells than there are rows
and the per-row refresh after it never runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain to be addressed.

No open issues 🎉

What changed in this PR

Follow-up to #17790 that restores coverage missed during the Vitest migration and strengthens tests that could pass without exercising their intended behavior.

Changes:

  • Add coverage for date-range picker behavior, drag cleanup, filtering menus, resource-string updates, and public directive collections.
  • Correct event propagation, frame timing, and filtering synchronization in existing grid tests.
  • Remove the redundant per-row refresh during column autosizing.
File Description
projects/​igniteui-angular/​src/​public_api.spec.ts Check directive collections are non-empty and contain defined standalone types.
projects/​igniteui-angular/​grids/​tree-grid/​src/​tree-grid-selection.spec.ts Wait for filtering completion before checking cascade selection.
projects/​igniteui-angular/​grids/​pivot-grid/​src/​pivot-grid.spec.ts Test date-dimension regeneration after global resource changes.
projects/​igniteui-angular/​grids/​grid/​src/​grid-filtering-advanced.spec.ts Test resource updates in an open advanced-filtering dialog.
projects/​igniteui-angular/​grids/​grid/​src/​grid-excel-style-filtering-features.spec.ts Test reopening a templated menu after cancelling its custom dialog.
projects/​igniteui-angular/​grids/​grid/​src/​grid-base.directive.ts Remove redundant row refreshes before autosize measurements.
projects/​igniteui-angular/​grids/​grid/​src/​column-moving.spec.ts Strengthen Escape and cancellation tests with drag-ghost assertions and timing fixes.
projects/​igniteui-angular/​directives/​src/​directives/​drag-drop/​drag-drop.spec.ts Test destruction during window auto-scroll, including queued frame work.
projects/​igniteui-angular/​date-picker/​src/​date-range-picker/​date-range-picker.component.spec.ts Cover blur without a form control, clearing an open calendar, and date bounds.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants