Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

How do I make an ionic component render and hydrate in Jest tests

$
0
0

When running this test

 it('should render the button', (done) => {
      const button = fixture.debugElement.query(By.directive(IonButton));
      console.log(button.nativeElement.shadowRoot)
  });

the HTML output is:
<ion-button>Click me</ion-button>

I expect it to be similar to what I would see in a browser, like this:

<ion-button _ngcontent-dan-c164='' class='md button button-solid ion-activatable ion-focusable hydrated'>Click me
</ion-button>

The browser also has all the associated shadowDOM elements whereas the Jest test returns null when calling shadowRoot.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>