aurelia / aurelia/testing

`jest-dom` added additional condition to `toBeVisible` preventing use in component test.

Open
#102 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
38
Forks
27
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a bug report**

* **Library Version:**
1.1.0

**Please tell us about your environment:**
* **Operating System:**
Windows 11

* **Node Version:**
16.5.0

* **NPM Version:**
7.20.0

* **JSPM OR Webpack AND Version**
webpack: 5.72.1

* **Browser:**
jest component test

* **Language:**
typescript

**Current behavior:**
We recently updated our dependencies and it looks like jest-dom [changed](https://github.com/testing-library/jest-dom/pull/339) the behaviour of `toBeVisible` and added a new condition in `v5.11.10` so all versions since then (2021-03-25) have the same issue:

> it is present in the document

This is causing our component tests to fail with an exception, when we locate an element from the component and try to asset that it is visible.

image

I am assuming this can be fixed somehow by a change in the aurelia-testing package.

**Expected/desired behavior:**
it should not fail or throw an exception

* **What is the expected behavior?**

* **What is the motivation / use case for changing the behavior?**
the jest-dom package has added an extra condition to its `toBeVisible` method.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the component test failure with jest-dom v5.11.10 or later, then inspect the aurelia-testing package for its visibility assertion integration. Done means a component element can be checked with toBeVisible without an exception under the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
frontend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.