mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
ci(cypress): verify if card fields are populated on updating card info (#7743)
Co-authored-by: likhinbopanna <131246334+likhinbopanna@users.noreply.github.com>
This commit is contained in:
@ -3142,6 +3142,7 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState, order = 0) => {
|
||||
if (response.body.customer_payment_methods[order]?.payment_token) {
|
||||
const paymentToken =
|
||||
response.body.customer_payment_methods[order].payment_token;
|
||||
const cardInfo = response.body.customer_payment_methods[order].card;
|
||||
const paymentMethodId =
|
||||
response.body.customer_payment_methods[order].payment_method_id;
|
||||
const lastUsedAt =
|
||||
@ -3150,6 +3151,11 @@ Cypress.Commands.add("listCustomerPMCallTest", (globalState, order = 0) => {
|
||||
globalState.set("paymentMethodId", paymentMethodId);
|
||||
globalState.set("paymentToken", paymentToken);
|
||||
|
||||
if (cardInfo) {
|
||||
expect(cardInfo.expiry_year, "expiry_year").to.not.be.null;
|
||||
expect(cardInfo.card_holder_name, "card_holder_name").to.not.be.null;
|
||||
}
|
||||
|
||||
// Validate last_used_at timestamp
|
||||
expect(new Date(lastUsedAt).getTime(), "last_used_at").to.be.lessThan(
|
||||
Date.now()
|
||||
|
||||
Reference in New Issue
Block a user