From be7cb11699c691956b75c88884920a1fa4c42e45 Mon Sep 17 00:00:00 2001 From: Gleb Bahmutov Date: Mon, 4 May 2020 09:58:54 -0400 Subject: [PATCH] add issue example but fixed --- .../component/basic/use-render/my-component-spec.js | 9 +++++++++ cypress/component/basic/use-render/my-component.jsx | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 cypress/component/basic/use-render/my-component-spec.js create mode 100644 cypress/component/basic/use-render/my-component.jsx 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