question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(cdk/testing): harnesses treat tabs different depending on test environment

See original GitHub issue

Reproduction

https://travis-ci.org/github/e-hein/test-tabkey/branches

Expected Behavior

If I can switch from karma/jest to protractor I’d expect the same harness test to lead to the same results. In this case, I’d expected that senden TestKey.Tab to an TestElement it should select the next selectable element (or at least try to do so in the most common cases).

Alternative Behavior

Sending TestKey.Tab writes a \t into an input field in both environments.

Actual Behavior

  • Sending TestKey.Tab in ProtractorEnvironment selects the next input (=expected Behavior)
  • Sending TestKey.Tab in TestbedEnvironment does nothing (not even write \t)

Environment

  • Angular: 9.1.9
  • CDK/Material: cdk 9.2.4, material 9.2.4
  • Browser(s): Chrome, Firefox
  • Operating System (e.g. Windows, macOS, Ubuntu): Angular CLI: 9.1.9 Node: 12.18.0 OS: darwin x64 / Linux

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
e-heincommented, Aug 12, 2020

As stated at the end of #19946 further emulation of browser behavior is currently not in scope of angular/cdk. If you got a similar issue, I published my solutions at github.com/e-hein/emulate-tab and github.com/e-hein/emulate-key-in-browser (MIT License).

0reactions
angular-automatic-lock-bot[bot]commented, Sep 12, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

feat(@angular/cdk/testing): Component Harness Feedback
This is an open discussion aiming to regroup Component Harness feedback and improvement ideas. Most of the items below are focused on ...
Read more >
Tidy up your tests using component test harnesses - YouTube
Angular CDK's test harnesses allow us to write component unit tests that are easier to create and maintain. In this talk, we'll cover...
Read more >
Testing with component harnesses - Angular Material
The Angular CDK's component harnesses are designed to work in multiple different test environments. Support currently includes Angular's Testbed environment ...
Read more >
Create a component harness for your tests with Angular CDK
Learn how to create and consume a custom component harness using Angular CDK. With a step-by-step case study, we run it in unit...
Read more >
@angular/cdk | Yarn - Package Manager
bug fix, overlay: expand test environment check (#22927 ... New @angular/cdk/testing infrastructure and Angular Material test harnesses.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found