diff --git a/cypress/component/basic/use-render/my-component-spec.js b/cypress/component/basic/use-render/my-component-spec.js new file mode 100644 index 00000000..dd1e6893 --- /dev/null +++ b/cypress/component/basic/use-render/my-component-spec.js @@ -0,0 +1,9 @@ +import React from 'react' +import { mount } from 'cypress-react-unit-test' +import MyComponent from './my-component.jsx' + +// example from https://github.com/bahmutov/cypress-react-unit-test/issues/172 +it('is a test', () => { + mount() + cy.contains('Hello').should('be.visible') +}) diff --git a/cypress/component/basic/use-render/my-component.jsx b/cypress/component/basic/use-render/my-component.jsx new file mode 100644 index 00000000..111ca8fb --- /dev/null +++ b/cypress/component/basic/use-render/my-component.jsx @@ -0,0 +1,10 @@ +import React from 'react' + +class MyComponent extends React.Component { + state = {} + render() { + return
Hello
+ } +} + +export default MyComponent