Skip to content

bug(MatSelect): mat-select difficult to test in Zoneless jest/JSDOM environment without provideNoopAnimations() #32783

@MichaelDoyle

Description

@MichaelDoyle

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

MatSelect waits for a CSS animationend event to close, which never fires in the JSDOM test environment.

  • Zone change detection works
  • Zoneless CD with provideNoopAnimations() works

Since (a) the dependency on the animations package was removed in Sept 2025, and (b) within the animations package, provideNoopAnimations() is scheduled to go away in v23, I am wondering what the recommended path will be.

Our current workaround is to inject ANIMATION_MODULE_TYPE in our tests. e.g.)

await TestBed.configureTestingModule({
  imports: [...],
  providers: [
    provideZonelessChangeDetection(),
    { provide: ANIMATION_MODULE_TYPE, useValue: 'NoopAnimations' },
  ],
}).compileComponents();

Reproduction

StackBlitz link:
Steps to reproduce:
1.
2.

Expected Behavior

A standardized way to test without provideNoopAnimations().

Actual Behavior

Tests that depend on waiting for the mat-select overlay to close fail.

Environment

  • Angular:
  • CDK/Material:
  • Browser(s):
  • Operating System (e.g. Windows, macOS, Ubuntu):

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions