Skip to content

Writing to HTMLSelectElement.value throws TypeError #961

@jessharrell

Description

@jessharrell

Reproduction example

https://github.com/jessharrell/angular13-dropdown-testing

Prerequisites

  1. Render an Angular component with a Select
  2. use user-event to select an option
  3. failure occurs on destruction of component (which happens by default in angular 13)

Expected behavior

No exception is thrown.

Actual behavior

TypeError: 'set' on proxy: trap returned falsish for property 'value'
at DefaultDomRenderer2.setProperty (node_modules/@angular/platform->browser/fesm2020/platform-browser.mjs:642:12)
at BaseAnimationRenderer.setProperty (node_modules/@angular/platform-browser/fesm2020/animations.mjs:292:27)
at SelectControlValueAccessor.setProperty (node_modules/@angular/forms/fesm2020/forms.mjs:49:24)
at SelectControlValueAccessor.writeValue (node_modules/@angular/forms/fesm2020/forms.mjs:6065:14)
at NgSelectOption.ngOnDestroy (node_modules/@angular/forms/fesm2020/forms.mjs:6155:26)

User-event version

14.2.0

Environment

Testing Library framework: testing-library/[email protected],
JS framework: [email protected]
Test environment: [email protected]
DOM implementation: Jsdom

Additional context

Initially filed issue with angular forms. They believe this exception is due to the way user-event is setting the value property on the HTMLSelectElement. Please see issue for more details.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions