Skip to content

bug(ComponentHarness): TestElement.sendKeys(TestKey.ENTER) is missing Keyboard Event code #27034

Closed
@rstreidt-cisco

Description

@rstreidt-cisco

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

When calling sendKey with TestKey.ENTER on a TestElement, the keyboard event that gets generated shows blank for the code property.

Reproduction

Steps to reproduce:

  1. Run sendKeys(TestKey.ENTER) on any TestElement
  2. Check the Keyboard Event code value.

See StackBlitz: https://stackblitz.com/edit/harness-issue-zpusdu?file=src%2Fapp%2Fmy-harness-example.spec.ts

Expected Behavior

Keyboard Event code value should be 'Enter'.

This is from testing out the Enter key on Mozilla's site with Chrome on Windows showing the correct code value:
keyboard-event

Actual Behavior

Keyboard Event code value is ''.

Environment

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

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: cdk/testing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions