Skip to content

[E2E][Bugfix] Fix usage for Object.hasOwn#3237

Merged
shethj merged 6 commits intodevelopfrom
hotfix/validate-project-type-err
Sep 4, 2025
Merged

[E2E][Bugfix] Fix usage for Object.hasOwn#3237
shethj merged 6 commits intodevelopfrom
hotfix/validate-project-type-err

Conversation

@shethj
Copy link
Contributor

@shethj shethj commented Sep 3, 2025

Description

We updated usage of hasOwnProperty with hasOwn to align with latest ECMA updates.
The usage in code was buggy as we were calling hasOwn on a plain JSON object while hasOwn is a static method of Object in JS. This caused TypeErrors.

This PR fixes usage of hasOwn

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Update usage of hasOwn

How to Test-Drive This PR

  • Checkout branch
  • Generate a new project by running: node e2e/scripts/generate-project.js --project-key retail-app-ext --templateVersion 8.0.0-dev.1
  • Run validatation script for generated project by running: node e2e/scripts/validate-generated-project.js retail-app-ext --templateVersion 8.0.0-dev.1
  • Expected behavior: No errors are thrown in the terminal.

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@shethj shethj requested a review from a team as a code owner September 3, 2025 14:26
@shethj shethj added the skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated label Sep 3, 2025
@cc-prodsec
Copy link
Collaborator

cc-prodsec commented Sep 3, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

})

test.skip('should inject B3 headers when __server_timing param is passed', async ({page}) => {
test('should inject B3 headers when __server_timing param is passed', async ({page}) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.. once we enable OTEL, then this test should pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set the env var in the workflow to enable OTEL so the test should pass.

@shethj shethj enabled auto-merge September 4, 2025 20:05
@shethj shethj merged commit af4a01c into develop Sep 4, 2025
43 checks passed
@shethj shethj deleted the hotfix/validate-project-type-err branch September 4, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants