diff --git a/cypress/e2e/smoke/create_safe_form.cy.js b/cypress/e2e/smoke/create_safe_simple.cy.js similarity index 61% rename from cypress/e2e/smoke/create_safe_form.cy.js rename to cypress/e2e/smoke/create_safe_simple.cy.js index 650abe49dc..b03f487702 100644 --- a/cypress/e2e/smoke/create_safe_form.cy.js +++ b/cypress/e2e/smoke/create_safe_simple.cy.js @@ -2,11 +2,8 @@ const DEFAULT_OWNER_ADDRESS = '0xC16Db0251654C0a72E91B190d81eAD367d2C6fED' const OWNER_ADDRESS = '0xE297437d6b53890cbf004e401F3acc67c8b39665' describe('Create Safe form', () => { - before(() => { - localStorage.setItem('SAFE_v2__lastWallet', JSON.stringify('E2E Wallet')) - }) it('should navigate to the form', () => { - //cy.connectE2EWallet() + cy.connectE2EWallet() cy.visit('/welcome') @@ -27,6 +24,20 @@ describe('Create Safe form', () => { // Input a custom name cy.get('input[name="name"]').type('Test safe name').should('have.value', 'Test safe name') + }) + + it('should allow changing the network', () => { + // Switch to a different network + cy.get('[data-cy="create-safe-select-network"]').click() + cy.contains('Ethereum').click() + + // Network hint should be displayed + cy.contains('Change your wallet network').should('be.visible') + cy.contains('button', 'Next').should('be.disabled') + + // Switch back to Görli + cy.get('[data-cy="create-safe-select-network"]').click() + cy.contains('li span', 'Görli').click() cy.contains('button', 'Next').click() }) @@ -34,11 +45,19 @@ describe('Create Safe form', () => { it('should display a default owner and threshold', () => { // Default owner cy.get('input[name="owners.0.address"]').should('have.value', DEFAULT_OWNER_ADDRESS) - cy.get('input[name="owners.0.name"]').type('Test Owner Name').should('have.value', 'Test Owner Name') // Default threshold cy.get('input[name="threshold"]').should('have.value', 1) + }) + it('should allow changing the owner name', () => { + cy.get('input[name="owners.0.name"]').type('Test Owner Name') + cy.contains('button', 'Back').click() + cy.contains('button', 'Next').click() + cy.get('input[name="owners.0.name"]').should('have.value', 'Test Owner Name') + }) + + it('should add a new owner and update threshold', () => { // Add new owner cy.contains('button', 'Add new owner').click() cy.get('input[name="owners.1.address"]').should('exist') @@ -47,14 +66,21 @@ describe('Create Safe form', () => { // Update threshold cy.get('input[name="threshold"]').parent().click() cy.contains('li', '2').click() + }) + + it('should remove an owner and update threshold', () => { + // Remove owner + cy.get('button[aria-label="Remove owner"]').click() + + // Threshold should change back to 1 + cy.get('input[name="threshold"]').should('have.value', 1) cy.contains('button', 'Next').click() }) it('should display summary on review page', () => { cy.contains('Test safe name') - cy.contains(OWNER_ADDRESS) cy.contains(DEFAULT_OWNER_ADDRESS) - cy.contains('2 out of 2') + cy.contains('1 out of 1') }) }) diff --git a/src/components/new-safe/OwnerRow/index.tsx b/src/components/new-safe/OwnerRow/index.tsx index 103dc5895f..fbcafa3913 100644 --- a/src/components/new-safe/OwnerRow/index.tsx +++ b/src/components/new-safe/OwnerRow/index.tsx @@ -123,7 +123,7 @@ export const OwnerRow = ({ > {removable && ( <> - remove?.(index)}> + remove?.(index)} aria-label="Remove owner"> diff --git a/src/components/new-safe/create/steps/SetNameStep/index.tsx b/src/components/new-safe/create/steps/SetNameStep/index.tsx index 7416845c53..c740b10d26 100644 --- a/src/components/new-safe/create/steps/SetNameStep/index.tsx +++ b/src/components/new-safe/create/steps/SetNameStep/index.tsx @@ -86,7 +86,7 @@ function SetNameStep({ /> - +