Testing angular component - having a hard look at it




A typical unit test for Angular looks like this :-

We need to understand

a) A component or fixture represent our angular component which might include a single or more markups.

b) DebugElement are basically specific html markup like span or div that we would like to find after it is our component rendered.

So, in our test it is important to know what we've already initialized our component using code below :-





Next we get an instance of our component and check if it contains certain markups as shown below :-











Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm