Repository navigation
test(*): migrating to vitest - #17790
Merged
Merged
Conversation
Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
fix(lint): resolve parsing errors and style violations from vitest migration
Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
fix(schematics): exclude spec files from build compilation
- Add expect import to calendar-helper-utils.ts - Replace jasmine.getEnv() with vitest beforeEach/afterEach - Replace jasmine.createSpyObj with vi.fn() based mocks - Replace pending() with it.skip() - Fix expect() message syntax for vitest (message before assertion) - Remove deprecated exportExcel and exportCsv properties - Remove deprecated moveable property from column definitions - Fix mock emitter types to use any for compatibility Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
- Add GridPagingMode import and use GridPagingMode.Remote for RemotePagingComponent - Add GridSelectionMode import and use GridSelectionMode.none for MovableColumnsComponent - Add GridColumnDataType import and properly type columns in IgxGridAdvancedFilteringDynamicColumnsComponent Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
- Add isEditable, isHidden, isGroupable to MovableTemplatedColumnsComponent - Add paging property to MovableColumnsLargeComponent Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
fix(tests): Complete Vitest migration fixes for CI compilation errors
Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
Co-authored-by: ChronosSF <2188411+ChronosSF@users.noreply.github.com>
fix(tests): migrate expect assertion messages to Vitest format
Navigation tests slept 60 ms after each click, key press and navigateTo. Clicks need a frame and scrolls complete on the next scroll event, so one or two frames are enough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary navigation, scrolls and transaction updates slept 30-100 ms; one or two animation frames are enough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Edit mode focus (igxFocus focuses in requestAnimationFrame) and scrolls slept 16-500 ms; one or two animation frames are enough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scrolls slept 100 ms and key presses 30 ms; two frames and one frame are enough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scrolls slept 100 ms and pointer moves 30-50 ms. Scrolls complete on the next scroll event and pointer moves are throttled to one per frame, so one or two frames are enough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each row dimension cell creates its column with the standalone createComponent on every rowData change and never destroyed it. Angular tracks every live LView until it is destroyed, and the column injects the grid, so each orphan pinned the whole grid, its DOM and injector for the life of the page. Keep the ref, destroy it when the row data replaces the column and when the cell is destroyed (DestroyRef). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pivot grid regenerates its column hierarchy and row dimension header columns with the standalone createComponent on every configuration or data change, and in horizontal layout on every data rebinding. Unlike the base grid it never destroyed the old refs, so each column stayed in Angular's LView registry and pinned the grid. Track the hierarchy refs in the base _autoGeneratedColsRefs, which the base ngOnDestroy already destroys, and the dimension refs in a private list destroyed via DestroyRef. Destroy both on regeneration. This also frees the hidden measure columns that are created but never used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Child grids build their columns from the row island columns with the standalone createComponent() and never destroyed those refs. Angular tracks every live LView and each column injects its grid, so a leaked column kept the child grid, its DOM and the root grid alive for the life of the page. Keep the refs created by createColumnsList. Destroy the previous ones once the row island columns change and the grid drops them, and the rest when the grid is destroyed (DestroyRef). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
setState creates the columns and column groups missing from the grid with the standalone createComponent() and never destroyed them. Each one injects a grid, so it kept the grid, its DOM and the test injector alive for the life of the page. The state directive owns these refs: it creates them with its own injector, and grids have no API to adopt external refs (adding one would be new public API). A later columns restore for the same grid destroys the created columns that grid no longer uses; reused ones stay. The rest are destroyed with the directive (DestroyRef), which lives as long as its host grid. Columns created for a child grid that is destroyed earlier are therefore released with the root grid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The library tsconfig reaches the probe through test-setup.ts, and under strict checks the clearTimeout/clearInterval wrappers did not match the merged DOM and Node overloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a row view dies, the grid detaches its master-detail view so the view can be moved to another row later. After that the view lives only in the grid's detail cache and the dead outlet's cache. The grid's destroy cleaned only live outlets, so detached views were never destroyed and stayed in Angular's tracked view map, pinning their DOM and component trees after the grid was gone. Destroy the cached detail views when the grid is destroyed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each cell pointerdown adds a body pointerup listener that is removed only by its own handler. If the grid is destroyed before a pointerup reaches the body, the listener stays on the body and keeps the selection service, and through it the grid, alive. The service is provided per grid, so its DestroyRef ends with the grid. Remove the listener there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After a size change the row heights follow only once the rows' resize observer reported and its 40 ms throttle fired. One frame was enough alone but not under full-suite load. Wait two frames and advance the throttle, as the other pivot resize specs do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After setting the keys, the records render once the grid re-measures. One frame was enough alone but flaked under full-suite load. Poll for the first record instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The browser suites build their specs from source, so they no longer wait behind lint and the library, docs and elements builds. The build job keeps the Node-only tests and the dist-based SSR checks. Both browser jobs cache the Playwright Chromium by version and only install its system dependencies on a cache hit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every igxFor instance, one per grid row, appended a probe to the body and read its bounding rect to learn the engine's max element size. Each probe forces a layout of the whole document, yet the value is an engine constant that only changes with zoom. Cache it per document, probe edge and device pixel ratio. A zero result (no layout yet) is not cached, so a later instance probes again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every IgxIconService instance (one per injector, e.g. per TestBed) parsed the same 33 built-in SVGs into XML documents in its constructor. Keep the processed built-in markup in a module-level map keyed by source text and reuse it across instances. It holds strings, so no DOM is shared. Custom icons are still parsed per instance, keeping the map bounded. Registration, events and output are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the column and view leaks fixed, a test page peaks at about 1.5-2 GB instead of 3.5-4.5 GB. On a 12-core, 16 GB machine 6 workers ran the suite in 165 s vs 194 s with 4, and 8 were no faster. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
grid-filtering-ui.spec.ts ran ~80 s alone and set the floor of the parallel suite, since Vitest parallelises by file. Split it into five files of ~15-17 s each, balanced by per-test durations. Describe nesting and titles are repeated in every file, so all 281 full test names are unchanged. Helpers used by more than one file move to test-utils/grid-filtering-functions.spec.ts; the rest stay local. The Excel style filtering files that format 'fr-FR' dates now register the fr locale themselves; the filtering row suite used to do it for the whole file. The filtering row split keeps "Should navigate from left arrow button to first condition chip Tab." after its predecessor: run first on a fresh page, its debounce (setTimeout) loses the race with nextFrame and it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Typing in the filter row goes through the input's debounceTime, a 0 ms timer in the Angular zone. The spec waited a frame, which can fire before that timer on a fresh page, so the chip was never added and the test only passed after other tests had run. whenStable waits for the timer itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test element is pinned to the viewport's top-left corner, where the headless browser's cursor rests. Once the element is laid out under it, Chromium fires a trusted pointerover at (0, 0), which switches the directive to the top-left scroll zone right after the spec's synthetic event. Specs starting in another zone saw no or the wrong deltas. pointer-events: none blocks the real hover; dispatched events are not hit-tested, so the spec still drives the directive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into sstoychev/migrate-vitest
…into sstoychev/migrate-vitest
kdinev
enabled auto-merge (squash)
October 20, 2026 14:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #
Description
Motivation / Context
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)