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 1
1
/// <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
+ } )
5
12
} )
Original file line number Diff line number Diff line change
1
+ // @ts -ignore
2
+ const isComponentSpec = ( ) => Cypress . spec . specType === 'component'
3
+
1
4
/** Initialize an empty document with root element */
2
5
function renderTestingPlatform ( ) {
3
6
// Let's mount components under a new div with this id
@@ -17,6 +20,10 @@ function renderTestingPlatform() {
17
20
}
18
21
19
22
before ( ( ) => {
23
+ if ( ! isComponentSpec ( ) ) {
24
+ return
25
+ }
26
+
20
27
renderTestingPlatform ( )
21
28
} )
22
29
@@ -26,6 +33,9 @@ before(() => {
26
33
*
27
34
*/
28
35
function cleanupStyles ( ) {
36
+ if ( ! isComponentSpec ( ) ) {
37
+ return
38
+ }
29
39
const document = cy . state ( 'document' ) as Document
30
40
31
41
const styles = document . body . querySelectorAll ( 'style' )
Original file line number Diff line number Diff line change @@ -5,9 +5,12 @@ import { injectStylesBeforeElement } from './utils'
5
5
6
6
const rootId = 'cypress-root'
7
7
8
+ // @ts -ignore
9
+ const isComponentSpec = ( ) => Cypress . spec . specType === 'component'
10
+
8
11
function checkMountModeEnabled ( ) {
9
12
// @ts -ignore
10
- if ( Cypress . spec . specType !== 'component' ) {
13
+ if ( ! isComponentSpec ( ) ) {
11
14
throw new Error (
12
15
`In order to use mount or unmount functions please place the spec in component folder` ,
13
16
)
You can’t perform that action at this time.
0 commit comments