cypress-react-unit-test
Advanced tools
Comparing version 2.3.0 to 2.3.1
@@ -47,7 +47,11 @@ "use strict"; | ||
// like component name | ||
var parentDocument = window.parent.document; | ||
// @ts-ignore | ||
var specDocument = parentDocument.querySelector('iframe.spec-iframe').contentDocument; | ||
// @ts-ignore | ||
var appDocument = parentDocument.querySelector('iframe.aut-iframe').contentDocument; | ||
var hash = component.type.name; | ||
var document = cy.state('document'); | ||
var styles = document.querySelectorAll('head style'); | ||
var styles = specDocument.querySelectorAll('head style'); | ||
if (styles.length) { | ||
cy.log('injected %d styles', styles.length); | ||
cy.log("injected " + styles.length + " style(s)"); | ||
Cypress.stylesCache.set(hash, styles); | ||
@@ -67,10 +71,3 @@ } | ||
} | ||
var parentDocument = window.parent.document; | ||
// hmm, is this really project name? | ||
// @ts-ignore | ||
var projectName = Cypress.config('projectName'); | ||
var appIframeId = "Your App: '" + projectName + "'"; | ||
var appIframe = parentDocument.getElementById(appIframeId); | ||
// @ts-ignore | ||
var head = appIframe.contentDocument.querySelector('head'); | ||
var head = appDocument.querySelector('head'); | ||
styles.forEach(function (style) { | ||
@@ -77,0 +74,0 @@ head.appendChild(style); |
@@ -54,7 +54,12 @@ /// <reference path="./index.d.ts" /> | ||
// like component name | ||
const parentDocument = window.parent.document | ||
// @ts-ignore | ||
const specDocument = parentDocument.querySelector('iframe.spec-iframe').contentDocument | ||
// @ts-ignore | ||
const appDocument = parentDocument.querySelector('iframe.aut-iframe').contentDocument | ||
const hash = component.type.name | ||
const document = cy.state('document') | ||
let styles = document.querySelectorAll('head style') | ||
let styles = specDocument.querySelectorAll('head style') | ||
if (styles.length) { | ||
cy.log('injected %d styles', styles.length) | ||
cy.log(`injected ${styles.length} style(s)`) | ||
Cypress.stylesCache.set(hash, styles) | ||
@@ -72,10 +77,3 @@ } else { | ||
} | ||
const parentDocument = window.parent.document | ||
// hmm, is this really project name? | ||
// @ts-ignore | ||
const projectName = Cypress.config('projectName') | ||
const appIframeId = "Your App: '" + projectName + "'" | ||
const appIframe = parentDocument.getElementById(appIframeId) | ||
// @ts-ignore | ||
var head = appIframe.contentDocument.querySelector('head') | ||
const head = appDocument.querySelector('head') | ||
styles.forEach(function (style) { | ||
@@ -82,0 +80,0 @@ head.appendChild(style) |
{ | ||
"name": "cypress-react-unit-test", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Unit test React components using Cypress", | ||
@@ -39,2 +39,3 @@ "main": "dist", | ||
"babel-loader": "8.0.5", | ||
"css-loader": "2.1.0", | ||
"cypress": "3.1.5", | ||
@@ -46,2 +47,3 @@ "github-post-release": "1.13.1", | ||
"standard": "11.0.1", | ||
"style-loader": "0.23.1", | ||
"typescript": "2.9.2", | ||
@@ -48,0 +50,0 @@ "webpack": "4.29.4" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
21032
18
386