From c0d1ef0d8d5e437659eb377790ce4921d58e775d Mon Sep 17 00:00:00 2001 From: Kelly Phan Date: Fri, 3 Jan 2025 15:41:17 +0100 Subject: [PATCH] fix: e2e updates --- cypress/e2e/10-resources/t20-create-customer.cy.ts | 14 +++++++++----- .../customers/addDrawer/CustomerInformation.tsx | 3 --- src/pages/CreateCustomer.tsx | 1 + translations/base.json | 12 ++---------- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/10-resources/t20-create-customer.cy.ts b/cypress/e2e/10-resources/t20-create-customer.cy.ts index 5b335cb02..efb64071a 100644 --- a/cypress/e2e/10-resources/t20-create-customer.cy.ts +++ b/cypress/e2e/10-resources/t20-create-customer.cy.ts @@ -7,11 +7,15 @@ describe('Create customer', () => { it('should create customer', () => { cy.get('[data-test="create-customer"]').click() - cy.get('input[name="name"]').should('exist').type(customerName, { scrollBehavior: false }) + cy.url().should('include', '/customer/create') + + cy.get('[data-test="submit-customer"]').should('be.disabled') - cy.get('[data-test="submit"]').should('be.disabled') cy.get('input[name="externalId"]').type('id-george-de-la-jungle') - cy.get('[data-test="submit"]').click() + + cy.get('input[name="name"]').should('exist').type(customerName, { scrollBehavior: false }) + + cy.get('[data-test="submit-customer"]').click() cy.url().should('include', '/customer/') @@ -26,9 +30,9 @@ describe('Create customer', () => { cy.get('[data-test="create-customer"]').click() cy.get('input[name="name"]').type(randomId, { scrollBehavior: false }) - cy.get('[data-test="submit"]').should('be.disabled') + cy.get('[data-test="submit-customer"]').should('be.disabled') cy.get('input[name="externalId"]').type(randomId) - cy.get('[data-test="submit"]').click() + cy.get('[data-test="submit-customer"]').click() cy.url().should('include', '/customer/') cy.contains(randomId).should('exist') diff --git a/src/components/customers/addDrawer/CustomerInformation.tsx b/src/components/customers/addDrawer/CustomerInformation.tsx index 47f166fa5..31f742d6f 100644 --- a/src/components/customers/addDrawer/CustomerInformation.tsx +++ b/src/components/customers/addDrawer/CustomerInformation.tsx @@ -46,9 +46,6 @@ export const CustomerInformation: FC = ({ disabled={isEdition && !customer?.canEditAttributes} label={translate('text_624efab67eb2570101d117ce')} placeholder={translate('text_624efab67eb2570101d117d6')} - helperText={ - (!isEdition || customer?.canEditAttributes) && translate('text_624efab67eb2570101d117de') - } formikProps={formikProps} /> { variant="primary" disabled={!formikProps.isValid || !formikProps.dirty} onClick={() => formikProps.handleSubmit()} + data-test="submit-customer" > {isEdition ? translate('text_17295436903260tlyb1gp1i7') diff --git a/translations/base.json b/translations/base.json index cd94dcfa4..19c8724ed 100644 --- a/translations/base.json +++ b/translations/base.json @@ -516,15 +516,8 @@ "text_6405cac5c833dcf18cad0198": "Edit", "text_6405cac5c833dcf18cad0204": "Metadata successfully added to the invoice", "text_6405cac5c833dcf18cad01fb": "Metadata successfully edited on invoice", - "text_632b49e2620ea4c6d96c9650": "Add a plan to {{customerName}}", - "text_632b49e2620ea4c6d96c9652": "Add a customer", - "text_632b49e2620ea4c6d96c9654": "To create a customer, please fill out this form", "text_632b49e2620ea4c6d96c9662": "Billing information", "text_632b49e2620ea4c6d96c9666": "Create customer", - "text_632b4acf0c41206cbcb8c2f6": "Edit customer information", - "text_632b4acf0c41206cbcb8c2f8": "Edit customer information", - "text_632b4acf0c41206cbcb8c2fa": "Edit the customer’s information which will be displayed in the app and on the invoices.", - "text_632b4acf0c41206cbcb8c30c": "Edit customer information", "text_632b4acf0c41206cbcb8c324": "Currency", "text_632c6e59b73f9a54d4c7223f": "Your currency selection will be locked once customer carries a coupon, add-on, wallet or a subscription", "text_632c6e59b73f9a54d4c72247": "Currency", @@ -1735,10 +1728,10 @@ "text_624453d52e945301380e49c4": "Type a trial period number", "text_624453d52e945301380e49c6": "days", "text_6246b6bc6b25f500b779aa7a": "No billable metrics", - "text_624aa732d6af4e0103d40e61": "Collapse section", + "text_624aa732d6af4e0103d40e61": "Collapse", "text_624aa732d6af4e0103d40e65": "Delete charge", "text_624aa732d6af4e0103d40e6f": "Standard pricing", - "text_624aa79870f60300a3c4d074": "Expand section", + "text_624aa79870f60300a3c4d074": "Expand", "text_624ea7c29103fd010732ab7d": "Enter a number to move forward (use “.” for decimal)", "text_62a30bc79dae432fb055330b": "Apply charges monthly", "text_62b32ec6b0434070791c2d4c": "Weekly", @@ -1878,7 +1871,6 @@ "text_624efab67eb2570101d117c6": "Type a name", "text_624efab67eb2570101d117ce": "Customer external ID", "text_624efab67eb2570101d117d6": "Type an external ID", - "text_624efab67eb2570101d117de": "Use customer external ID defined in your backend", "text_6250304370f0f700a8fdc27d": "Details", "text_6250304370f0f700a8fdc283": "External ID", "text_6250304370f0f700a8fdc28b": "Assign a plan",