Description
As for test author the splitting tested HTML and fixture(id) ( within HTML and test JS module ) become significant inconvenience. It forced to switch between HTML and JS while the size of common identifier (id) is often comparable to size of tested HTML itself
<test-fixture id="SomeElementFixture">
<template>
<some-element></some-element>
</template>
</test-fixture>
someElement = fixture('SomeElementFixture');
Proposed
To pass an HTML string which will be instantiated instead of template body on separate HTML.
someElement = fixture(`<some-element></some-element>`);
Backward compatibe
The original signature with ID as parameter still will be in place. The HTML string could be detected either by presence of '<' character as 1st character of anywhere in string.
Benefits
- no need to jump between HTML and test module during test development and debug
- shorter code overall
- no need to rely on any IDs, explicit element reference is used instead
- no risk of using wrong IDs
- yada-yada
Description
As for test author the splitting tested HTML and fixture(id) ( within HTML and test JS module ) become significant inconvenience. It forced to switch between HTML and JS while the size of common identifier (id) is often comparable to size of tested HTML itself
Proposed
To pass an HTML string which will be instantiated instead of template body on separate HTML.
Backward compatibe
The original signature with ID as parameter still will be in place. The HTML string could be detected either by presence of '<' character as 1st character of anywhere in string.
Benefits