Unit Testing Elements Local DOM?

17 views
Skip to first unread message

jim.j...@gmail.com

unread,
Jun 22, 2015, 1:57:38 PM6/22/15
to polym...@googlegroups.com
From what I understand, the Local DOM is supposed to be the encapsulated implementation for a custom element.  For our project, we've been writing tests that verify certain things within the Local DOM to ensure that the element is rendering correctly.  However, as a general rule we like to write tests that test from the contract of a piece of code and verify that it is behaving correctly under various scenarios.  By writing tests that dig into the Local DOM, it feels like we're breaking encapsulation and testing the implementation for our elements, when we'd prefer not to have to care about their implementation as long as the behaviors are correct.  I'm curious to hear what other people think about this approach, and whether anyone has figured out a way to test custom elements without testing their Local DOM?  Looking at the PolymerElements repos on github, it seems that the tests for some elements follow the same approach we do, while other elements don't have their look and feel tested at all.
Reply all
Reply to author
Forward
0 new messages