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
…thorin-v1
  • Loading branch information
talentlessguy committed Jan 15, 2025
2 parents 174bca9 + c0be041 commit 0ccc72a
Show file tree
Hide file tree
Showing 14 changed files with 278 additions and 502 deletions.
40 changes: 36 additions & 4 deletions e2e/specs/stateless/createSubname.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ test('should allow creating a subname', async ({ page, makeName, login, makePage
})

const subnamesPage = makePageObject('SubnamesPage')
const recordsPage = makePageObject('RecordsPage')

await subnamesPage.goto(name)
await login.connect()
Expand All @@ -120,17 +121,30 @@ test('should allow creating a subname', async ({ page, makeName, login, makePage
await subnamesPage.getSubmitSubnameButton.click()
await subnamesPage.addMoreToProfileButton.click()
await page.getByTestId('profile-record-option-name').click()
await page.getByTestId('profile-record-option-description').click()
await page.getByTestId('add-profile-records-button').click()
await page
.getByTestId('profile-record-input-input-eth')
.fill('0x42D63ae25990889E35F215bC95884039Ba354115')
await page.getByTestId('profile-record-input-input-name').fill('Test Name')
await page
.getByTestId('profile-record-input-description')
.getByRole('textbox')
.fill('New profile')

await subnamesPage.getSubmitSubnameProfileButton.click()

const transactionModal = makePageObject('TransactionModal')
await transactionModal.autoComplete()

const subname = `test.${name}`
await subnamesPage.goto(subname)
await recordsPage.goto(subname)

await expect(page).toHaveURL(new RegExp(`/${subname}`), { timeout: 15000 })
await expect(recordsPage.getRecordValue('text', 'name')).toHaveText('Test Name')
await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('New profile')
await expect(recordsPage.getRecordValue('address', 'eth')).toHaveText(
'0x42D63ae25990889E35F215bC95884039Ba354115',
)
})

test('should allow creating a subnames if the user is the wrapped owner', async ({
Expand All @@ -146,7 +160,7 @@ test('should allow creating a subnames if the user is the wrapped owner', async
type: 'wrapped',
})
const subnamesPage = makePageObject('SubnamesPage')

const recordsPage = makePageObject('RecordsPage')
await page.goto(`/${name}`)
await login.connect()

Expand All @@ -156,14 +170,32 @@ test('should allow creating a subnames if the user is the wrapped owner', async
await subnamesPage.getAddSubnameButton.click()
await subnamesPage.getAddSubnameInput.fill('test')
await subnamesPage.getSubmitSubnameButton.click()

await subnamesPage.addMoreToProfileButton.click()
await page.getByTestId('profile-record-option-name').click()
await page.getByTestId('profile-record-option-description').click()
await page.getByTestId('add-profile-records-button').click()
await page
.getByTestId('profile-record-input-input-eth')
.fill('0x42D63ae25990889E35F215bC95884039Ba354115')
await page.getByTestId('profile-record-input-input-name').fill('Test Name')
await page
.getByTestId('profile-record-input-description')
.getByRole('textbox')
.fill('New profile')
await subnamesPage.getSubmitSubnameProfileButton.click()

const transactionModal = makePageObject('TransactionModal')
await transactionModal.autoComplete()

const subname = `test.${name}`

await expect(page).toHaveURL(new RegExp(`/${subname}`), { timeout: 15000 })
await recordsPage.goto(subname)
await expect(recordsPage.getRecordValue('text', 'name')).toHaveText('Test Name')
await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('New profile')
await expect(recordsPage.getRecordValue('address', 'eth')).toHaveText(
'0x42D63ae25990889E35F215bC95884039Ba354115',
)
})

test('should not allow adding a subname that already exists', async ({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"jsdom": "^24.1.0",
"knip": "^5.27.2",
"lokijs": "^1.5.12",
"msw": "^1.2.3",
"msw": "^2.6.8",
"multiformats": "^12.0.1",
"next-compose-plugins": "^2.2.1",
"next-dev-https": "^0.1.2",
Expand Down
Loading

0 comments on commit 0ccc72a

Please sign in to comment.