Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test case for dynamic fields #839

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aritro2002
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

add cypress test for testing dynamic fields

How did you test it?

Screen.Recording.2024-12-16.at.4.17.23.PM.mov

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@aritro2002 aritro2002 added Ready for Review PR with label Ready for Review should only be reviewed. Testing Add this label if the PR contains Testing related changes labels Dec 16, 2024
@aritro2002 aritro2002 self-assigned this Dec 16, 2024
Copy link

semanticdiff-com bot commented Dec 16, 2024

Review changes with  SemanticDiff

Changed Files
File Status
  cypress-tests/cypress/e2e/dynamic-field-test.cy.ts  0% smaller
  cypress-tests/cypress/support/utils.ts  0% smaller

@@ -80,6 +80,48 @@ export const createPaymentBody = {

}

export const createPaymentBodyWithoutBillingAddress = {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can reuse the exisiting create body and remove billing and shipping from that object.


expect(requiredFields).to.have.property('billing.address.city');
expect(requiredFields['billing.address.city'].value).to.be.null;

Copy link
Contributor

Choose a reason for hiding this comment

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

remove shipping also as mentioned in the below comment. And then please add assertions for shipping fields too.

},
profile_id: "pro_5fVcCxU8MFTYozgtf0P8",
}

export const changeObjectKeyValue = (object: Record<string, any>, key: string, value: boolean | string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to this function, create a function to delete a field from an object and use it to delete billing and shipping from existing create payment body object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Review PR with label Ready for Review should only be reviewed. Testing Add this label if the PR contains Testing related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants