From b443a6d7b55256cb64c51babddc32c13c0b1ec05 Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Wed, 20 Sep 2023 16:59:20 +0800 Subject: [PATCH] fix e2e errors --- e2e/specs/stateful/profile.spec.ts | 8 ------ e2e/specs/stateless/permissions.spec.ts | 2 -- .../RolesSection/components/RoleRow.test.tsx | 26 +++++++++---------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/e2e/specs/stateful/profile.spec.ts b/e2e/specs/stateful/profile.spec.ts index ef401983a..9cea3e933 100644 --- a/e2e/specs/stateful/profile.spec.ts +++ b/e2e/specs/stateful/profile.spec.ts @@ -210,14 +210,6 @@ test.describe('Profile', () => { // should show details in more tab await page.getByTestId('more-tab').click() - // should have correct ownership data - for (const owner of profile.owners) { - await expect(page.getByTestId(`owner-button-name-name.${owner.type}`)).toContainText( - owner.value, - { timeout: 25000 }, - ) - } - // should have view link for registration transaction await page.getByTestId('more-tab').click() await expect(page.getByTestId('etherscan-registration-link')).toHaveAttribute( diff --git a/e2e/specs/stateless/permissions.spec.ts b/e2e/specs/stateless/permissions.spec.ts index 471b7fd08..cdab460d9 100644 --- a/e2e/specs/stateless/permissions.spec.ts +++ b/e2e/specs/stateless/permissions.spec.ts @@ -379,7 +379,6 @@ test.describe('Permissions', () => { const morePage = makePageObject('MorePage') await profilePage.goto(subname) - await login.connect() await expect(profilePage.deleteSubnameButton).toBeVisible() @@ -388,7 +387,6 @@ test.describe('Permissions', () => { await expect(subnamesPage.getAddSubnameButton).toBeVisible() await morePage.goto(subname) - await expect(morePage.getSendNameButton).toBeVisible() await expect(morePage.editResolverButton).toBeVisible() }) }) diff --git a/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleRow.test.tsx b/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleRow.test.tsx index 203fa8c0f..f9f46d5f3 100644 --- a/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleRow.test.tsx +++ b/src/components/pages/profile/[name]/tabs/OwnershipTab/sections/RolesSection/components/RoleRow.test.tsx @@ -11,26 +11,26 @@ jest.mock('@app/hooks/usePrimary', () => ({ describe('RoleRow', () => { it('should render', () => { - render() + render() }) it('should display role tags', () => { - render() + render() expect(screen.getByText('roles.owner.title')).toBeVisible() expect(screen.getByText('roles.manager.title')).toBeVisible() }) it('should display tooltip when hovering role tags', async () => { - render() + render() expect(screen.queryByText('roles.owner.description')).toEqual(null) await userEvent.hover(screen.getByText('roles.owner.title')) await waitFor(() => { - expect(screen.getByText('roles.owner.description')).toBeVisible() + expect(screen.getByText('tabs.ownership.tooltips.owner-emancipated')).toBeVisible() }) }) it('should display dropdown with option to view and copy address', async () => { - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible() @@ -40,7 +40,7 @@ describe('RoleRow', () => { it('should display view name and copy name if usePrimary returns a name', async () => { mockUsePrimary.mockReturnValueOnce({data: {name: 'test.eth'}}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('wallet.viewProfile')).toBeVisible() @@ -50,7 +50,7 @@ describe('RoleRow', () => { it('should not display view name and copy name if usePrimary returns no name', async () => { mockUsePrimary.mockReturnValueOnce({data: undefined}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible() @@ -61,7 +61,7 @@ describe('RoleRow', () => { it('should display etherscn name and copy name if usePrimary returns a name', async () => { mockUsePrimary.mockReturnValueOnce({data: {name: 'test.eth'}}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('wallet.viewProfile')).toBeVisible() @@ -71,7 +71,7 @@ describe('RoleRow', () => { it('should not display view name and copy name if usePrimary returns no name', async () => { mockUsePrimary.mockReturnValueOnce({data: undefined}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible() @@ -82,7 +82,7 @@ describe('RoleRow', () => { it('should display view on etherscan if usePrimary returns name and name is 2LDEth', async () => { mockUsePrimary.mockReturnValueOnce({data: {name: 'test.eth'}}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible() @@ -92,7 +92,7 @@ describe('RoleRow', () => { it('should display view on etherscan if usePrimary returns subaname and name is wrapped', async () => { mockUsePrimary.mockReturnValueOnce({data: {name: 'sub.test.eth'}}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible() @@ -102,7 +102,7 @@ describe('RoleRow', () => { it('should display edit roles option if action type `edit-roles`', async () => { mockUsePrimary.mockReturnValueOnce({data: {name: 'sub.test.eth'}}) - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible() @@ -111,7 +111,7 @@ describe('RoleRow', () => { }) it('should display sync manager option if roles includes `manager` and action includes type `sync-manager`', async () => { - render() + render() await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC')) await waitFor(() => { expect(screen.getByText('address.viewAddress')).toBeVisible()