@cypress/angular
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -11,3 +11,3 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, EventEmitter } from '@angular/core'; | ||
import { Component, EventEmitter, SimpleChange } from '@angular/core'; | ||
import { getTestBed, TestBed } from '@angular/core/testing'; | ||
@@ -95,2 +95,6 @@ import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; | ||
window.Mocha['__zone_patch__'] = false; | ||
// 'zone.js/testing' is not properly aliasing `it.skip` but it does provide `xit`/`xspecify` | ||
// Written up under https://github.com/angular/angular/issues/46297 but is not seeing movement | ||
// so we'll patch here pending a fix in that library | ||
globalThis.it.skip = globalThis.xit; | ||
/** | ||
@@ -199,2 +203,15 @@ * Bootstraps the TestModuleMetaData passed to the TestBed | ||
} | ||
// Manually call ngOnChanges when mounting components using the class syntax. | ||
// This is necessary because we are assigning input values to the class directly | ||
// on mount and therefore the ngOnChanges() lifecycle is not triggered. | ||
if (component.ngOnChanges && config.componentProperties) { | ||
const { componentProperties } = config; | ||
const simpleChanges = Object.entries(componentProperties).reduce((acc, [key, value]) => { | ||
acc[key] = new SimpleChange(null, value, true); | ||
return acc; | ||
}, {}); | ||
if (Object.keys(componentProperties).length > 0) { | ||
component.ngOnChanges(simpleChanges); | ||
} | ||
} | ||
return component; | ||
@@ -201,0 +218,0 @@ } |
{ | ||
"name": "@cypress/angular", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Test Angular Components using Cypress", | ||
@@ -37,3 +37,3 @@ "main": "dist/index.js", | ||
}, | ||
"homepage": "https://github.com/cypress-io/cypress/blob/master/npm/angular/#readme", | ||
"homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/angular/#readme", | ||
"author": "Jordan Powell", | ||
@@ -40,0 +40,0 @@ "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fangular&template=1-bug-report.md&title=", |
@@ -81,3 +81,3 @@ # @cypress/angular | ||
[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/master/LICENSE) | ||
[![license](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cypress-io/cypress/blob/develop/LICENSE) | ||
@@ -84,0 +84,0 @@ This project is licensed under the terms of the [MIT license](/LICENSE). |
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
19449
384