-
Notifications
You must be signed in to change notification settings - Fork 60
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
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
@@ -80,6 +80,48 @@ export const createPaymentBody = { | |||
|
|||
} | |||
|
|||
export const createPaymentBodyWithoutBillingAddress = { |
There was a problem hiding this comment.
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; | ||
|
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
Type of Change
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
npm run re:build