You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rendering mapped lists elements semantically is a coveted feature from frameworks like React and Vue. phantom has the capability (rudimentary, but works), but there is currently no tests coverage for it.
Where to start
Start simple. You can use a small example for an initial test:
And compare it to the resulting DOM element after rendering listTest() with phantom./
2. Another solution is to simply render listTest() and check the DOM programatically. Pseudocode:
Render a simple listTest() component inside a phantomComponent (refer to README and/or examples)
Select the outermost element that listTest() rendered to the DOM
Check that it has equal length to the original list variable before mapping
Check that there are no stray commas, textNodes, etc
Check any other edge cases
Try also, at your own pace, to familiarize yourself with the phantom engine in phantom.ts. There is currently a TODO: line where mapped elements are handled. That will be its own issue as well. Any ideas are welcome.
The text was updated successfully, but these errors were encountered:
Where
__tests__
Rationale
Let's look at
examples/todo
, in theTodoList
component:Rendering mapped lists elements semantically is a coveted feature from frameworks like React and Vue.
phantom
has the capability (rudimentary, but works), but there is currently no tests coverage for it.Where to start
Start simple. You can use a small example for an initial test:
You can take several approaches to test this component:
1. One is to make a mock DOM string which would be your
expected
value:And compare it to the resulting DOM element after rendering
listTest()
withphantom
./2. Another solution is to simply render
listTest()
and check the DOM programatically. Pseudocode:listTest()
component inside aphantomComponent
(refer to README and/or examples)listTest()
rendered to the DOMlist
variable before mappingTry also, at your own pace, to familiarize yourself with the
phantom
engine inphantom.ts
. There is currently aTODO:
line where mapped elements are handled. That will be its own issue as well. Any ideas are welcome.The text was updated successfully, but these errors were encountered: