This repository was archived by the owner on Mar 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
cypress/integration/integration tests Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 11/// <reference types="cypress" />
2- it ( 'loads page for E2E' , ( ) => {
3- cy . visit ( 'index.html' )
4- cy . window ( ) . should ( 'have.property' , 'React' )
2+ describe ( 'integration tests' , ( ) => {
3+ it ( 'loads page for E2E' , ( ) => {
4+ cy . visit ( 'index.html' )
5+ cy . window ( ) . should ( 'have.property' , 'React' )
6+ } )
7+
8+ it ( 'loads page again' , ( ) => {
9+ cy . visit ( 'index.html' )
10+ cy . window ( ) . should ( 'have.property' , 'React' )
11+ } )
512} )
Original file line number Diff line number Diff line change 1+ // @ts -ignore
2+ const isComponentSpec = ( ) => Cypress . spec . specType === 'component'
3+
14/** Initialize an empty document with root element */
25function renderTestingPlatform ( ) {
36 // Let's mount components under a new div with this id
@@ -17,6 +20,10 @@ function renderTestingPlatform() {
1720}
1821
1922before ( ( ) => {
23+ if ( ! isComponentSpec ( ) ) {
24+ return
25+ }
26+
2027 renderTestingPlatform ( )
2128} )
2229
@@ -26,6 +33,9 @@ before(() => {
2633 *
2734 */
2835function cleanupStyles ( ) {
36+ if ( ! isComponentSpec ( ) ) {
37+ return
38+ }
2939 const document = cy . state ( 'document' ) as Document
3040
3141 const styles = document . body . querySelectorAll ( 'style' )
Original file line number Diff line number Diff line change @@ -5,9 +5,12 @@ import { injectStylesBeforeElement } from './utils'
55
66const rootId = 'cypress-root'
77
8+ // @ts -ignore
9+ const isComponentSpec = ( ) => Cypress . spec . specType === 'component'
10+
811function checkMountModeEnabled ( ) {
912 // @ts -ignore
10- if ( Cypress . spec . specType !== 'component' ) {
13+ if ( ! isComponentSpec ( ) ) {
1114 throw new Error (
1215 `In order to use mount or unmount functions please place the spec in component folder` ,
1316 )
You can’t perform that action at this time.
0 commit comments