Skip to content

Commit b6f3eea

Browse files
committed
Merge branch 'develop' into merge_develop_15
2 parents 83467ad + 99055ec commit b6f3eea

File tree

7 files changed

+49
-7
lines changed

7 files changed

+49
-7
lines changed

cli/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ _Released 07/29/2025 (PENDING)_
3131

3232
- Fixed an issue where Create from Component feature might not be able to parse React components from project files. Fixed in [#31457](https://github.com/cypress-io/cypress/pull/31457).
3333
- Fixed an issue where `isSecureContext` would be `false` on localhost when testing with Cypress. Addresses [#18217](https://github.com/cypress-io/cypress/issues/18217).
34+
- Fixed an issue where Angular legacy `Output()` decorators were broken when making component instance field references safe. Fixes [#32137](https://github.com/cypress-io/cypress/issues/32137).
35+
- Upgraded `tmp` from `~0.2.3` to `~0.2.4`. This removes the [CVE-2025-54798](https://github.com/advisories/GHSA-52f5-9888-hmc6) vulnerability being reported in security scans. Addresses [#32176](https://github.com/cypress-io/cypress/issues/32176).
3436

3537
**Misc:**
3638

@@ -45,7 +47,7 @@ _Released 07/29/2025 (PENDING)_
4547

4648
## 14.5.4
4749

48-
_Released 8/12/2025 (PENDING)_
50+
_Released 8/07/2025_
4951

5052
**Dependency Updates:**
5153

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"request-progress": "^3.0.0",
6161
"semver": "^7.7.1",
6262
"supports-color": "^8.1.1",
63-
"tmp": "~0.2.3",
63+
"tmp": "~0.2.4",
6464
"tree-kill": "1.2.2",
6565
"untildify": "^4.0.0",
6666
"yauzl": "^2.10.0"

npm/angular/src/mount.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,10 @@ function setupComponent<T> (
424424
getComponentOutputs(fixture.componentRef.componentType).forEach((key) => {
425425
const property = component[key]
426426

427-
if (property instanceof EventEmitter) {
427+
// With the introduction of https://github.com/cypress-io/cypress/pull/31993, we want to make sure that component inputs are reference safe inside cy.mount().
428+
// However, the exception to this is if the user passes in a Cypress output spy as a property in order to maintain backwards compatibility.
429+
// @ts-expect-error
430+
if (property instanceof EventEmitter || (config?.componentProperties?.hasOwnProperty(key) && config?.componentProperties[key] instanceof EventEmitter)) {
428431
// only assign props if they are passed into the component
429432
if (config?.componentProperties?.hasOwnProperty(key)) {
430433
// @ts-expect-error
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { SignalsInputComponent } from './signals.input.component'
2+
import { createOutputSpy, mount } from 'cypress/angular'
3+
4+
describe('with output spies', () => {
5+
// regression test for https://github.com/cypress-io/cypress/issues/32137
6+
it('should emit events on button click', () => {
7+
mount(SignalsInputComponent, {
8+
componentProperties: {
9+
newOutput: createOutputSpy('newOutput'),
10+
oldOutput: createOutputSpy('oldOutput'),
11+
},
12+
})
13+
14+
cy.get('#test-button').click()
15+
cy.get('@oldOutput').should('have.been.called')
16+
cy.get('@newOutput').should('have.been.called')
17+
})
18+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<button id="test-button" (click)="onButtonClick()">Test</button>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Component, EventEmitter, Output, output } from '@angular/core'
2+
import { CommonModule } from '@angular/common'
3+
4+
@Component({
5+
selector: 'signals-input-component',
6+
standalone: true,
7+
imports: [CommonModule],
8+
templateUrl: './signals.input.component.html',
9+
})
10+
export class SignalsInputComponent {
11+
newOutput = output()
12+
@Output() oldOutput: EventEmitter<void> = new EventEmitter()
13+
14+
onButtonClick () {
15+
this.newOutput.emit()
16+
this.oldOutput.emit()
17+
}
18+
}

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30484,10 +30484,10 @@ tmp@^0.0.33:
3048430484
dependencies:
3048530485
os-tmpdir "~1.0.2"
3048630486

30487-
tmp@^0.2.0, tmp@^0.2.1, tmp@~0.2.1, tmp@~0.2.3:
30488-
version "0.2.3"
30489-
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.3.tgz#eb783cc22bc1e8bebd0671476d46ea4eb32a79ae"
30490-
integrity sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==
30487+
tmp@^0.2.0, tmp@^0.2.1, tmp@~0.2.1, tmp@~0.2.4:
30488+
version "0.2.4"
30489+
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.4.tgz#c6db987a2ccc97f812f17137b36af2b6521b0d13"
30490+
integrity sha512-UdiSoX6ypifLmrfQ/XfiawN6hkjSBpCjhKxxZcWlUUmoXLaCKQU0bx4HF/tdDK2uzRuchf1txGvrWBzYREssoQ==
3049130491

3049230492
to-absolute-glob@^2.0.0:
3049330493
version "2.0.2"

0 commit comments

Comments
 (0)