I've two directives which display based on a variable being configured.
This visually worked but during acceptance tests I found a problem. I attempted to assert that if the <settingElement>
hasn't been clicked (configuring the var selected
), neither directive is displayed. The test passed for <directiveA>
but failed for <directiveB>
leaving me a little confused.
An example of the code is below:
<settingElement ng-click="selected = trueOrFalse()"></settingElement>
<directiveA ng-show="selected"></directiveA>
<directiveB ng-show="!selected"></directiveB>