Socket
Socket
Sign inDemoInstall

cypress-react-unit-test

Package Overview
Dependencies
0
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.0 to 2.3.1

19

dist/index.js

@@ -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"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc