Ember-Mocha + Ember-Cli-Mocha = invalid /tests HTML
- Dominant language
- JavaScript
- Stars
- 130
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
A project with both `ember-cli-mocha` and `ember-mocha` as top-level ember addons will result in duplicate fixture HTML being rendered. Unfortunately, this also means that more than one DOM element has the same `id`. [This is not allowed.](https://www.w3.org/TR/html5/dom.html#element-attrdef-global-id)

The end result is that tests will pass, but the developer will not be able to easily inspect the rendered app in the 50% scaled frame (the second set of DOM elements) due to the real testing being done in the first set of DOM elements.
Removing `ember-cli-mocha` from the app's `package.json` resolves this problem.
#### Possible root cause
the contentFor hook of this addon is
https://github.com/emberjs/ember-mocha/blob/13be23a36a6af0f6f1cffe934b905a2bbe1fd39e/index.js#L66-L77
and for `ember-cli-mocha`
https://github.com/ember-cli/ember-cli-mocha/blob/64d8742b7fdc8535f76b545fb7fc7c6d6c97b01c/index.js#L10-L13
```ts
contentFor(type) {
let output = this.eachAddonInvoke('contentFor', [type]);
return output.join('\n');
},
```
It's possible that this results in `ember-mocha`'s fixture HTML being inserted twice
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.