Skip to content

Commit

Permalink
fix e2e errors
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Sep 20, 2023
1 parent 8bc1a27 commit b443a6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
8 changes: 0 additions & 8 deletions e2e/specs/stateful/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 0 additions & 2 deletions e2e/specs/stateless/permissions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ test.describe('Permissions', () => {
const morePage = makePageObject('MorePage')

await profilePage.goto(subname)

await login.connect()

await expect(profilePage.deleteSubnameButton).toBeVisible()
Expand All @@ -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()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ jest.mock('@app/hooks/usePrimary', () => ({

describe('RoleRow', () => {
it('should render', () => {
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
})

it('should display role tags', () => {
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={['manager', 'owner']} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={['manager', 'owner']} actions={[]} isWrapped isEmancipated/>)
expect(screen.getByText('roles.owner.title')).toBeVisible()
expect(screen.getByText('roles.manager.title')).toBeVisible()
})

it('should display tooltip when hovering role tags', async () => {
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={['manager', 'owner']} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={['manager', 'owner']} actions={[]} isWrapped isEmancipated/>)
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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('wallet.viewProfile')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('wallet.viewProfile')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped={false}/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped={false} isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand All @@ -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(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[{ label: 'action.editRoles', type: 'edit-roles'} as any]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={[]} actions={[{ label: 'action.editRoles', type: 'edit-roles'} as any]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand All @@ -111,7 +111,7 @@ describe('RoleRow', () => {
})

it('should display sync manager option if roles includes `manager` and action includes type `sync-manager`', async () => {
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={['manager']} actions={[{ label: 'action.syncManager', type: 'sync-manager'} as any]} isWrapped/>)
render(<RoleRow address="0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" roles={['manager']} actions={[{ label: 'action.syncManager', type: 'sync-manager'} as any]} isWrapped isEmancipated/>)
await userEvent.click(screen.getByTestId('role-row-button-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'))
await waitFor(() => {
expect(screen.getByText('address.viewAddress')).toBeVisible()
Expand Down

0 comments on commit b443a6d

Please sign in to comment.