Instructor: All right,
I hope you had some success putting that test together
to make sure that our app component shows an instance
of the comment list.
So in this section we're gonna walk through
the actual implementation of that test.
I'm gonna first get started
by importing the comment list component into this file.
Anytime we want to say that,
yeah the app shows this other component,
we need to actually know what that other component is.
So at the top up here,
I'm going to import comment list from comment list.
Then once I've got that imported,
I'll then create an it statement down here
that's going to attempt to write out that test
and make the actual expectation.
So I'll say it, which is a reference to the app
not an actual like programmatic reference
but kinda like a verbal reference of sorts.
So it shows a comment list.
Then inside of here we'll create an instance
of our app component using the shallow render
just as we did before.
We'll say const wrapped = shallow(<App /).
And then we'll write out our expectation.
So I'll make sure that wrapped.find
and we're gonna look for an instance of comment list
and I expect there to be an array coming back
of all the copies of the comment list that were found,
so I want to get specifically just the length of that list
and I want to make sure that the length is equal to one
'cause we should only have one copy of the comment list.
So I'll put down my matcher of twoEqual
and say that the value should equal one.
All right, so I'll save this file
and I'll flip back over my terminal and see how I'm doing.
So back over here, it looks like my tests are running
and I've got a second passing test.
Awesome, so this looks pretty good
and hopefully you came to the same solution as well.
Let's take a break right here
and we'll continue in the next section.