Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ensdomains/ens-app-v3 into …
Browse files Browse the repository at this point in the history
…socket-optimize
  • Loading branch information
talentlessguy committed Nov 8, 2024
2 parents a8b7453 + 0478c78 commit d72f7c0
Show file tree
Hide file tree
Showing 28 changed files with 859 additions and 298 deletions.
32 changes: 16 additions & 16 deletions e2e/specs/stateless/extendNames.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { daysToSeconds } from '@app/utils/time'

import { test } from '../../../playwright'

test('should be able to register multiple names on the address page', async ({
test('should be able to extend multiple names (including names in grace preiod) on the address page', async ({
page,
accounts,
login,
Expand All @@ -26,11 +26,13 @@ test('should be able to register multiple names on the address page', async ({
label: 'extend-legacy',
type: 'legacy',
owner: 'user2',
duration: -24 * 60 * 60,
},
{
label: 'wrapped',
type: 'wrapped',
owner: 'user2',
duration: -24 * 60 * 60,
},
])

Expand Down Expand Up @@ -65,29 +67,27 @@ test('should be able to register multiple names on the address page', async ({

// warning message
await expect(page.getByText('You do not own all these names')).toBeVisible()
await page.locator('button:has-text("I understand")').click()
await page.getByTestId('extend-names-confirm').click()

// name list
await page.waitForLoadState('networkidle')
await expect(page.getByText(`Extend ${extendableNameItems.length} Names`)).toBeVisible()
page.locator('button:has-text("Next")').waitFor({ state: 'visible' })
await page.locator('button:has-text("Next")').waitFor({ state: 'visible' })
await page.locator('button:has-text("Next")').click()

// check the invoice details
await page.waitForLoadState('networkidle')
await expect(page.getByText('1 year extension', { exact: true })).toBeVisible()
// increment and save
// TODO: Reimplement when date duration bug is fixed
// await expect(page.getByText('1 year extension', { exact: true })).toBeVisible()
await expect(page.getByTestId('plus-minus-control-label')).toHaveText('1 year')
await page.getByTestId('plus-minus-control-plus').click()
await expect(page.getByTestId('plus-minus-control-label')).toHaveText('2 years')
await page.getByTestId('plus-minus-control-plus').click()
await page.waitForLoadState('networkidle')
await expect(page.getByTestId('invoice-item-0-amount')).not.toBeEmpty()
await expect(page.getByTestId('invoice-item-1-amount')).not.toBeEmpty()
await expect(page.getByTestId('invoice-total')).not.toBeEmpty()

page.locator('button:has-text("Next")').waitFor({ state: 'visible' })
await page.locator('button:has-text("Next")').click()
await page.waitForLoadState('networkidle')
await expect(page.getByTestId('plus-minus-control-label')).toHaveText('3 years')
await expect(page.getByTestId('invoice-item-0-amount')).not.toHaveText('0.0000 ETH')
await expect(page.getByTestId('invoice-item-1-amount')).not.toHaveText('0.0000 ETH')
await expect(page.getByTestId('invoice-total')).not.toHaveText('0.0000 ETH')

await page.getByTestId('extend-names-confirm').click()
await expect(transactionModal.transactionModal).toBeVisible({ timeout: 10000 })
await transactionModal.autoComplete()

await expect(page.getByText('Your "Extend names" transaction was successful')).toBeVisible({
Expand Down Expand Up @@ -373,7 +373,7 @@ test('should be able to extend a name by a month', async ({
await test.step('should show the correct price data', async () => {
await expect(extendNamesModal.getInvoiceExtensionFee).toContainText('0.0003')
await expect(extendNamesModal.getInvoiceTransactionFee).toContainText('0.0001')
await expect(extendNamesModal.getInvoiceTotal).toContainText('0.0004')
await expect(extendNamesModal.getInvoiceTotal).toContainText(/0\.000[3|4]/)
await expect(page.getByText(/1 month .* extension/)).toBeVisible()
})

Expand Down
Loading

0 comments on commit d72f7c0

Please sign in to comment.