Skip to content

Commit

Permalink
fix: e2e updates
Browse files Browse the repository at this point in the history
  • Loading branch information
keellyp committed Jan 3, 2025
1 parent 5cf64d1 commit 9cedd3e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
14 changes: 9 additions & 5 deletions cypress/e2e/10-resources/t20-create-customer.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/')

Expand All @@ -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')

Expand Down
3 changes: 0 additions & 3 deletions src/components/customers/addDrawer/CustomerInformation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ export const CustomerInformation: FC<CustomerInformationProps> = ({
disabled={isEdition && !customer?.canEditAttributes}
label={translate('text_624efab67eb2570101d117ce')}
placeholder={translate('text_624efab67eb2570101d117d6')}
helperText={
(!isEdition || customer?.canEditAttributes) && translate('text_624efab67eb2570101d117de')
}
formikProps={formikProps}
/>
<ComboBoxField
Expand Down
1 change: 1 addition & 0 deletions src/pages/CreateCustomer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ const CreateCustomer = () => {
variant="primary"
disabled={!formikProps.isValid || !formikProps.dirty}
onClick={() => formikProps.handleSubmit()}
data-test="submit-customer"
>
{isEdition
? translate('text_17295436903260tlyb1gp1i7')
Expand Down
12 changes: 2 additions & 10 deletions translations/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 9cedd3e

Please sign in to comment.