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
…feat/FET-1575-fix
  • Loading branch information
LeonmanRolls committed Aug 30, 2024
2 parents 9ee876a + 1979541 commit 05abbb5
Show file tree
Hide file tree
Showing 154 changed files with 10,708 additions and 2,066 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ tsconfig.vitest-temp.json
/archives
/data
/test-environment
/ganache

# hardhat
/cache
/artifacts
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.2
20.13.1
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ artifacts
cache
coverage
data
ganache
out
subgraphs

Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
"i18n-ally.localesPaths": [
"public/locales"
],
"i18n-ally.keystyle": "nested"
"i18n-ally.keystyle": "nested",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
11 changes: 11 additions & 0 deletions e2e/specs/stateful/dnsclaim.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,15 @@ test.describe('Import DNSSEC name', () => {
await expect(page.getByTestId('status-checker-message')).toContainText('Invalid record found')
await expect(page.getByTestId('import-next-button')).toBeDisabled()
})

test('should resolve .pw domains', async ({ page, login }) => {
await page.goto('/test.pw')
await login.connect()

await page.getByTestId('onchain-radio').click()
await page.getByTestId('import-next-button').click()
await expect(page.getByTestId('import-heading')).toContainText('Enable DNSSEC')
await expect(page.getByTestId('status-checker-message')).toContainText('DNSSEC is not enabled')
await expect(page.getByTestId('import-next-button')).toBeDisabled()
})
})
1 change: 1 addition & 0 deletions e2e/specs/stateless/deleteSubname.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test.describe('unwrapped', () => {

await profilePage.goto(subname)
await login.connect()
await page.pause()

// Manager button should exist
await expect(page.getByTestId('owner-profile-button-name.manager')).toBeVisible()
Expand Down
42 changes: 25 additions & 17 deletions e2e/specs/stateless/extendNames.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ test('should be able to register multiple names on the address page', async ({
makePageObject,
makeName,
}) => {
const names = await makeName([
// Generating names in not neccessary but we want to make sure that there are names to extend
await makeName([
{
label: 'extend-legacy',
type: 'legacy',
Expand All @@ -32,16 +33,28 @@ test('should be able to register multiple names on the address page', async ({
const transactionModal = makePageObject('TransactionModal')

await addresPage.goto(address)

await login.connect()
await page.pause()

await addresPage.selectToggle.click()

await expect(await page.locator('.name-detail-item').count()).toBeGreaterThan(0)
const nameItems = await page.locator('.name-detail-item').all()
const nameItemTestIds = await Promise.all(
nameItems.map((item) => item.getAttribute('data-testid')),
)
const extendableNameItems = nameItemTestIds
.filter((testid): testid is string => !!testid)
.map((testid) => testid.replace('name-item-', ''))
.filter((name) => {
const nameParts = name?.split('.') ?? []
return nameParts.length === 2 && nameParts[1] === 'eth'
})

const timestampDict: { [key: string]: number } = {}
for (const name of names) {
const label = name.replace('.eth', '')
await addresPage.search(label)
for (const name of extendableNameItems) {
const timestamp = await addresPage.getTimestamp(name)
timestampDict[name] = timestamp
await addresPage.getNameRow(name).click()
}
await addresPage.extendNamesButton.click()

Expand All @@ -53,16 +66,10 @@ test('should be able to register multiple names on the address page', async ({
await addresPage.extendNamesModalNextButton.click()

// check the invoice details
await expect(page.getByTestId('invoice-item-0-amount')).toContainText('0.0065')
await expect(page.getByTestId('invoice-item-1-amount')).toContainText('0.0002')
await expect(page.getByTestId('invoice-total')).toContainText('0.0067')
await page.pause()
await expect(page.getByText(`Extend ${extendableNameItems.length} Names`)).toBeVisible()
await expect(page.getByText('1 year extension', { exact: true })).toBeVisible()

// check the price comparison table
await expect(page.getByTestId('year-marker-0')).toContainText('3% gas')
await expect(page.getByTestId('year-marker-1')).toContainText('1% gas')
await expect(page.getByTestId('year-marker-2')).toContainText('1% gas')

// increment and save
await page.getByTestId('plus-minus-control-plus').click()
await page.getByTestId('plus-minus-control-plus').click()
Expand All @@ -72,11 +79,12 @@ test('should be able to register multiple names on the address page', async ({

await subgraph.sync()
await page.reload()
for (const name of names) {
await page.waitForTimeout(3000)
for (const name of extendableNameItems) {
const label = name.replace('.eth', '')
await addresPage.search(label)
await expect(addresPage.nameExpiry(name)).not.toHaveText(/12/, { timeout: 30000 })
expect(await addresPage.getTimestamp(name)).toEqual(timestampDict[name] + 31536000000 * 3)
await expect(await addresPage.getTimestamp(name)).not.toBe(timestampDict[name])
await expect(await addresPage.getTimestamp(name)).toBe(timestampDict[name] + 31536000000 * 3)
}
})

Expand Down
37 changes: 37 additions & 0 deletions e2e/specs/stateless/myNames.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { expect } from '@playwright/test'
import { testClient } from '@root/playwright/fixtures/contracts/utils/addTestContracts'

import { test } from '../../../playwright'
import { Name } from '../../../playwright/fixtures/makeName'

test('myNames', async ({ page, login, makeName }) => {
await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 })
await testClient.mine({ blocks: 1 })

const nameConfig: Name[] = Array.from({ length: 20 }).map((_, i) => ({
label: `name${i}`,
type: 'legacy',
owner: 'user2',
}))

const names = await makeName(nameConfig)

await page.goto('/')
await login.connect('user2')
await page.pause()

await page.goto('/my/names')

const timestamps = await Promise.all(
names.map(async (name) => {
return page
.getByTestId(`name-item-${name}`)
.getByTestId('short-expiry')
.getAttribute('data-timestamp')
}),
)

expect(timestamps.every((timestamp) => timestamp === timestamps[0])).toBe(true)

await page.pause()
})
15 changes: 10 additions & 5 deletions e2e/specs/stateless/profileEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ test.describe('migrations', () => {
test('should be able to update to latest resolver when profile has been migrated on current and latest resolver', async ({
page,
login,
accounts,
makeName,
makePageObject,
}) => {
Expand All @@ -284,7 +285,7 @@ test.describe('migrations', () => {
})

// Add records to latest resolver
await generateRecords()({
await generateRecords({ accounts })({
name,
owner: 'user',
resolver: newResolver,
Expand Down Expand Up @@ -341,6 +342,7 @@ test.describe('migrations', () => {
test('should be able to reset the latest resolver when profile has been migrated on current and latest resolver', async ({
page,
login,
accounts,
makeName,
makePageObject,
}) => {
Expand All @@ -353,7 +355,7 @@ test.describe('migrations', () => {
})

// Add records to latest resolver
await generateRecords()({
await generateRecords({ accounts })({
name,
owner: 'user',
resolver: newResolver,
Expand Down Expand Up @@ -402,6 +404,7 @@ test.describe('migrations', () => {
test('should be able to choose to migrate to the latest profile when the current and latest resolver are not in sync', async ({
page,
login,
accounts,
makeName,
makePageObject,
}) => {
Expand All @@ -414,7 +417,7 @@ test.describe('migrations', () => {
})

// Add records to latest resolver
await generateRecords()({
await generateRecords({ accounts })({
name,
owner: 'user',
resolver: newResolver,
Expand Down Expand Up @@ -473,6 +476,7 @@ test.describe('migrations', () => {
test('should be able migrate the current profile when the current and latest resolver are not in sync', async ({
page,
login,
accounts,
makeName,
makePageObject,
}) => {
Expand All @@ -485,7 +489,7 @@ test.describe('migrations', () => {
})

// Add records to latest resolver
await generateRecords()({
await generateRecords({ accounts })({
name,
owner: 'user',
resolver: newResolver,
Expand Down Expand Up @@ -549,6 +553,7 @@ test.describe('migrations', () => {
test('should be able to reset the profile when the current and latest resolver are not in sync', async ({
page,
login,
accounts,
makeName,
makePageObject,
}) => {
Expand All @@ -561,7 +566,7 @@ test.describe('migrations', () => {
})

// Add records to latest resolver
await generateRecords()({
await generateRecords({ accounts })({
name,
owner: 'user',
resolver: newResolver,
Expand Down
Loading

0 comments on commit 05abbb5

Please sign in to comment.