Skip to content

Commit

Permalink
Merge branch 'main' into fet1720-optional-unwrapped-registration
Browse files Browse the repository at this point in the history
  • Loading branch information
sugh01 authored Jan 19, 2025
2 parents ce0ef1e + 7a55583 commit 8102737
Show file tree
Hide file tree
Showing 21 changed files with 340 additions and 341 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
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"knip:fix": "knip --fix --allow-remove-files"
},
"dependencies": {
"@adraffy/ens-normalize": "1.10.1",
"@ensdomains/address-encoder": "1.1.1",
"@ensdomains/content-hash": "^3.0.0-beta.5",
"@ensdomains/ens-contracts": "1.2.0-beta.0",
Expand Down Expand Up @@ -79,7 +78,6 @@
"i18next-http-backend": "^1.4.1",
"idb-keyval": "^6.2.1",
"immer": "^9.0.15",
"intl-segmenter-polyfill": "^0.4.4",
"iso-639-1": "^2.1.15",
"markdown-to-jsx": "^7.1.7",
"next": "13.5.6",
Expand Down Expand Up @@ -119,7 +117,6 @@
"@testing-library/react": "^14.0.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/lodash": "^4.14.184",
"@types/node": "^18.7.13",
"@types/pako": "^2.0.0",
"@types/prettier": "^2.7.0",
Expand All @@ -132,7 +129,6 @@
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/spy": "^2.0.5",
"canvas": "^2.9.3",
"cbor": "^8.1.0",
"dotenv": "^16.0.1",
"eslint": "8.50.0",
Expand All @@ -156,10 +152,7 @@
"husky": "^7.0.4",
"jsdom": "^24.1.0",
"knip": "^5.27.2",
"lokijs": "^1.5.12",
"msw": "^1.2.3",
"multiformats": "^12.0.1",
"next-compose-plugins": "^2.2.1",
"msw": "^2.6.8",
"next-dev-https": "^0.1.2",
"next-router-mock": "^0.9.10",
"pako": "^2.1.0",
Expand Down
Loading

0 comments on commit 8102737

Please sign in to comment.