A
A
AlexFo902019-05-29 12:13:20
Unit testing
AlexFo90, 2019-05-29 12:13:20

How to check with the help of tests, there is a component on the page?

Good afternoon, please tell me how to check if a component is present on the page using jest and puppeteer?

describe('MyComponent', () => {
  it('компонента MyComponent присутствует на странице', async () => {
    ...
  };
};

I can’t find suitable methods in any way ...
if you can tell me more, there is one waitForSelector('selector') method, it seems to search by the selector, and if I have a modular css , then how to get to selector? and you can check as something else not by the selector? Thank you! import styles from '../../MyComponent.module.css';

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question