When I do snapshot testing, for example, what is the difference if I write in this way:
it('Should render correctly', () => {
const { container } = render<MyComponent />;
expect(container).toMatchSnapshot();
})
vs when I specify container.firstChild
it('Should render correctly', () => {
const { container } = render<MyComponent />;
expect(container.firstChild).toMatchSnapshot();
})
I couldn't google any answers on this.