Answers
- The
Fact
attribute is missing from the test method. - We would use the
Assert.Contains
method in theAssert
class. - The test filename needs to end with
.test.tsx
. So, if we rename the fileList.test.tsx
, then the test will get picked up. - We can use the following code to check an object isn't
null
:expect(result).not.toBeNull();
- We can use the
toEqual
Jest matcher function to compare objects:expect(person).toEqual({ id: 1, firstName: "Tom", surname: "Smith" });
- We can use the following Cypress command to check the page heading:
cy.contains('Sign In');
- We can use the following Cypress command to check that Loading… only appears while data is being fetched:
cy.contains('Loading...'); cy.contains('Loading...').should('not.exist');
The first command will check that the page renders
Loading...
on the initial...