aurelia / aurelia/testing

[ComponentTester] ref + innerhtml not working

Open
#91 5 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**
ref and innerhtml not working when using the component tester.

* ** Steps to reproduce **
1) checkout repo: https://github.com/michaelw85/repo-aurelia-test-issue
2) npm install
3) au jest

au jest will result in an error for the ref issue.
the innerhtml issue is visible in the jest snapshot.

To verify the icons are actually functioning in a normal app use `au run` to open the dev-app.

* **Library Version:**
aurelia-testing: 1.0.0

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

* **Node Version:**
v10.15.0

* **NPM Version:**
6.9.0

* **JSPM OR Webpack AND Version**
Plugin setup created with CLI, default TS configuration

* **Language:**
TS

**Current behavior:**
When using a ref binding it is undefined in a unit test when using the component tester.
`TypeError: Cannot read property 'setAttribute' of undefined` (setAttribute is performed on the elements being referenced)

innerhtml is not rendered, here's a jest snapshot:
```html




```

**Expected/desired behavior:**
ref should work when using the component tester.
innerhtml binding should render when using component tester.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.