Skip to content

Commit

Permalink
Merge branch 'main' into FET-1689
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Dec 3, 2024
2 parents ba7a65e + e648cea commit ef50c58
Show file tree
Hide file tree
Showing 43 changed files with 1,655 additions and 2,194 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pages-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Cloudflare Pages
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NEXT_PUBLIC_INTERCOM_ID: re9q5yti
NEXT_PUBLIC_DRPC_KEY: AnmpasF2C0JBqeAEzxVO8aTteiMlrW4R75hpDonbV6cR

on: [push]
jobs:
Expand Down
6 changes: 3 additions & 3 deletions deploy/00_deploy_bulk_renewal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
import { Interface } from '@ethersproject/abi'
import { utils } from 'ethers'
import { ethers } from 'hardhat'
import { DeployFunction } from 'hardhat-deploy/types'
import { HardhatRuntimeEnvironment } from 'hardhat/types'
Expand Down Expand Up @@ -49,15 +49,15 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
console.log('Set interface implementor of eth tld for bulk renewal')
const tx2 = await resolver.setInterface(
ethers.utils.namehash('eth'),
computeInterfaceId(new Interface(bulkRenewal.abi)),
computeInterfaceId(new utils.Interface(bulkRenewal.abi)),
bulkRenewal.address,
)
await tx2.wait()

console.log('Set interface implementor of eth tld for registrar controller')
const tx3 = await resolver.setInterface(
ethers.utils.namehash('eth'),
computeInterfaceId(new Interface(controllerArtifact.abi)),
computeInterfaceId(new utils.Interface(controllerArtifact.abi)),
controller.address,
)
await tx3.wait()
Expand Down
1 change: 0 additions & 1 deletion e2e/specs/stateful/address.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ test('should go to the address page', async ({ page, login }) => {
await page.goto('/')
await login.connect()

await page.pause()
await page
.getByPlaceholder('Search for a name')
.fill('0xFc5958B4B6F9a06D21E06429c8833f865577acf0')
Expand Down
113 changes: 111 additions & 2 deletions e2e/specs/stateless/_importName.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,33 @@ import { expect } from '@playwright/test'

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

test('should allow claim (owned by user)', async ({ page, login, accounts, makePageObject }) => {
// When testing locally, reducers will be run twice because of strict mode
const strictModeEventCount = process.env.CI ? 1 : 2

test('should allow claim (owned by user)', async ({
page,
login,
accounts,
makePageObject,
consoleListener,
}) => {
console.log(strictModeEventCount)
const name = 'swagabc.xyz'
await consoleListener.initialize({
regex: new RegExp(
`Event triggered on local development.*?(${[
'search_selected_dns',
'dns_selected_import_type',
'dns_sec_enabled',
'dns_verified_ownership',
'dns_claim_started',
'dns_claimed',
'dns_approve_registrar_wallet_opened',
'dns_import_wallet_opened',
'dns_claim_wallet_opened',
].join('|')})`,
),
})

const homePage = makePageObject('HomePage')
const importPage = makePageObject('ImportPage')
Expand All @@ -14,7 +39,17 @@ test('should allow claim (owned by user)', async ({ page, login, accounts, makeP

// should redirect to registration page
await homePage.searchInput.fill(name)
await page.locator(`[data-testid="search-result-name"]`, { hasText: name }).waitFor()
await page.locator(`[data-testid="search-result-name"]`, { hasText: 'Not Imported' }).waitFor()
await homePage.searchInput.press('Enter')

await test.step('should fire DNS import tracking event: search_selected_dns', async () => {
await expect(consoleListener.getMessages()).toHaveLength(1)

await expect(consoleListener.getMessages().toString()).toContain('search_selected_dns')
consoleListener.clearMessages()
})

await expect(importPage.heading).toHaveText(`Claim ${name}`)

// no type should be checked yet
Expand All @@ -31,6 +66,15 @@ test('should allow claim (owned by user)', async ({ page, login, accounts, makeP
// should jump straight to transaction step
await expect(importPage.heading).toHaveText('Claim your domain')

await test.step('should fire DNS import tracking event: dns_selected_import_type', async () => {
await expect(consoleListener.getMessages()).toHaveLength(strictModeEventCount)

await expect(consoleListener.getMessages().toString()).toMatch(
new RegExp(`dns_selected_import_type.*?${name}`),
)
consoleListener.clearMessages()
})

// should show cost value above 0
await expect(importPage.getCost()).resolves.toBeGreaterThan(0)

Expand All @@ -39,10 +83,26 @@ test('should allow claim (owned by user)', async ({ page, login, accounts, makeP

await importPage.nextButton.click()

await test.step('should fire DNS import tracking event: dns_claim_started', async () => {
await expect(consoleListener.getMessages()).toHaveLength(1)

await expect(consoleListener.getMessages().toString()).toContain('dns_claim_started')
consoleListener.clearMessages()
})

// should be two steps: approve and claim
await expect(transactionModal.getStepCount()).resolves.toEqual(2)

await transactionModal.confirm()

await test.step('should fire DNS import tracking event: dns_approve_registrar_wallet_opened', async () => {
await expect(consoleListener.getMessages()).toHaveLength(1)
await expect(consoleListener.getMessages().toString()).toContain(
'dns_approve_registrar_wallet_opened',
)
consoleListener.clearMessages()
})

await transactionModal.complete()

// should save transaction status on refresh
Expand All @@ -59,6 +119,12 @@ test('should allow claim (owned by user)', async ({ page, login, accounts, makeP
await expect(page.getByText('Open Wallet')).toBeVisible()
await transactionModal.confirm()

await test.step('should fire DNS import tracking event: dns_claim_wallet_opened', async () => {
await expect(consoleListener.getMessages()).toHaveLength(1)
await expect(consoleListener.getMessages().toString()).toContain('dns_claim_wallet_opened')
consoleListener.clearMessages()
})

// should show complete step
await expect(page.getByText('Congratulations!')).toBeVisible()
await expect(page.getByText(`You are now the owner of ${name}`)).toBeVisible()
Expand All @@ -69,9 +135,24 @@ test('should allow claim (owned by user)', async ({ page, login, accounts, makeP
)
})

test('should allow import (not owned by user)', async ({ page, login, makePageObject }) => {
test('should allow import (not owned by user)', async ({
page,
login,
makePageObject,
consoleListener,
}) => {
const name = 'taytems.xyz'

await consoleListener.initialize({
regex: new RegExp(
`Event triggered on local development.*?(${[
'search_selected_dns',
'dns_selected_import_type',
'dns_verified_ownership',
].join('|')})`,
),
})

const homePage = makePageObject('HomePage')
const importPage = makePageObject('ImportPage')
const transactionModal = makePageObject('TransactionModal')
Expand All @@ -81,7 +162,19 @@ test('should allow import (not owned by user)', async ({ page, login, makePageOb

// should redirect to registration page
await homePage.searchInput.fill(name)
await page.locator(`[data-testid="search-result-name"]`, { hasText: name }).waitFor()
await page.locator(`[data-testid="search-result-name"]`, { hasText: 'Not Imported' }).waitFor()
await homePage.searchInput.press('Enter')

await test.step('should fire DNS import tracking event: search_selected_dns', async () => {
await expect(consoleListener.getMessages()).toHaveLength(1)

await expect(consoleListener.getMessages().toString()).toMatch(
new RegExp(`search_selected_dns.*?${name}`),
)
consoleListener.clearMessages()
})

await expect(importPage.heading).toHaveText(`Claim ${name}`)

// no type should be checked yet
Expand All @@ -95,6 +188,15 @@ test('should allow import (not owned by user)', async ({ page, login, makePageOb
await expect(importPage.nextButton).toBeEnabled({ timeout: 15000 })
await importPage.nextButton.click()

await test.step('should fire DNS import tracking event: dns_selected_import_type', async () => {
await expect(consoleListener.getMessages()).toHaveLength(strictModeEventCount)

await expect(consoleListener.getMessages().toString()).toMatch(
new RegExp(`dns_selected_import_type.*?${name}`),
)
consoleListener.clearMessages()
})

// should show verify ownership step with error message
await expect(importPage.heading).toHaveText('Verify Ownership')
await expect(
Expand All @@ -107,6 +209,13 @@ test('should allow import (not owned by user)', async ({ page, login, makePageOb

await importPage.nextButton.click()

await test.step('should fire DNS import tracking event: dns_verified_ownership', async () => {
await expect(consoleListener.getMessages()).toHaveLength(strictModeEventCount)

await expect(consoleListener.getMessages().toString()).toContain('dns_verified_ownership')
consoleListener.clearMessages()
})

// should go to transaction step
await expect(importPage.heading).toHaveText('Import this domain')

Expand Down
5 changes: 2 additions & 3 deletions e2e/specs/stateless/advancedEditor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ test('should maintain state and when returning from transaction modal when addin

await recordsPage.goto(name)
await login.connect()
await page.pause()

// Validate records
await expect(recordsPage.getRecordValue('text', 'name')).toHaveText('Bob')
Expand Down Expand Up @@ -257,7 +256,7 @@ test('should maintain state and when returning from transaction modal when addin
await transactionModal.autoComplete()

// Validate change in records
await page.pause()

await expect(recordsPage.getRecordValue('text', 'name')).toHaveText('Nick')
await expect(recordsPage.getRecordValue('text', 'another text')).toHaveText('another record')
await expect(recordsPage.getRecordValue('address', 'bnb')).toHaveText(
Expand All @@ -266,7 +265,7 @@ test('should maintain state and when returning from transaction modal when addin
await expect(recordsPage.getRecordValue('address', 'eth')).toHaveText(
'0x70997970C51812dc3A010C7d01b50e0d17dc79C8',
)
await page.pause()

await expect(recordsPage.getRecordValue('contentHash')).toHaveText(
'bzz://e40101fa011b20d1de9994b4d039f6548d191eb26786769f580809256b4685ef316805265ea162'.toLowerCase(),
)
Expand Down
1 change: 0 additions & 1 deletion e2e/specs/stateless/deleteSubname.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ 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
5 changes: 0 additions & 5 deletions e2e/specs/stateless/extendNames.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ test('should be able to extend a single unwrapped name in grace period from prof

const timestamp = await profilePage.getExpiryTimestamp()

await page.pause()
await profilePage.getExtendButton.click()

const extendNamesModal = makePageObject('ExtendNamesModal')
Expand Down Expand Up @@ -343,7 +342,6 @@ test('should be able to extend a name by a month', async ({
await profilePage.goto(name)
await login.connect()

await page.pause()
const timestamp = await profilePage.getExpiryTimestamp()
await profilePage.getExtendButton.click()

Expand Down Expand Up @@ -408,7 +406,6 @@ test('should be able to extend a name by a day', async ({
await profilePage.goto(name)
await login.connect()

await page.pause()
const timestamp = await profilePage.getExpiryTimestamp()
await profilePage.getExtendButton.click()

Expand Down Expand Up @@ -475,7 +472,6 @@ test('should be able to extend a name in grace period by a month', async ({

const timestamp = await profilePage.getExpiryTimestamp()

await page.pause()
await profilePage.getExtendButton.click()

const extendNamesModal = makePageObject('ExtendNamesModal')
Expand Down Expand Up @@ -552,7 +548,6 @@ test('should be able to extend a name in grace period by 1 day', async ({

const timestamp = await profilePage.getExpiryTimestamp()

await page.pause()
await profilePage.getExtendButton.click()

const extendNamesModal = makePageObject('ExtendNamesModal')
Expand Down
18 changes: 7 additions & 11 deletions e2e/specs/stateless/ownership.2LD.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect } from '@playwright/test'
import { test } from '../../../playwright'

test.describe('Unwrapped 2LD - Owner and Manager', () => {
test('Send feature', async ({ page, login, accounts, makeName, makePageObject }) => {
test('Send feature', async ({ login, accounts, makeName, makePageObject }) => {
const name = await makeName({
label: 'owner-manager',
type: 'legacy',
Expand Down Expand Up @@ -48,7 +48,6 @@ test.describe('Unwrapped 2LD - Owner and Manager', () => {

await transactionModal.autoComplete()

await page.pause()
await expect(ownershipPage.roleRow(accounts.getAddress('user3'))).toContainText('owner', {
timeout: 15000,
})
Expand Down Expand Up @@ -368,7 +367,6 @@ test.describe('Unwrapped 2LD - Manager Only', () => {
await ownershipPage.goto(name)
await login.connect()

await page.pause()
expect(await ownershipPage.getExpiryTimestamp()).toBeGreaterThan(0)
await expect(ownershipPage.expiryPanelRegistrationDate).toHaveCount(1)
await expect(ownershipPage.expiryPanelGracePeriod).toHaveCount(1)
Expand Down Expand Up @@ -518,7 +516,7 @@ test.describe('Wrapped and Emancipated 2LD - Owner', () => {
})

test.describe('Grace Period Unwrapped 2LD', () => {
test('Send feature', async ({ page, login, makeName, makePageObject }) => {
test('Send feature', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'grace-period-unwrapped',
type: 'legacy',
Expand All @@ -538,7 +536,6 @@ test.describe('Grace Period Unwrapped 2LD', () => {
await ownershipPage.goto(name)
await login.connect()

await page.pause()
await expect(ownershipPage.sendNameButton).toHaveCount(0)
})

Expand Down Expand Up @@ -567,7 +564,7 @@ test.describe('Grace Period Unwrapped 2LD', () => {
await expect(ownershipPage.syncManagerButton).toHaveCount(0)
})

test('Edit Roles', async ({ page, login, accounts, makeName, makePageObject }) => {
test('Edit Roles', async ({ login, accounts, makeName, makePageObject }) => {
const name = await makeName({
label: 'grace-period-unwrapped',
type: 'legacy',
Expand All @@ -580,7 +577,7 @@ test.describe('Grace Period Unwrapped 2LD', () => {

await ownershipPage.goto(name)
await login.connect()
await page.pause()

await ownershipPage.editRolesButton.click()

await expect(editRolesModal.roleCardChangeButton('owner')).toHaveCount(0)
Expand Down Expand Up @@ -630,7 +627,7 @@ test.describe('Grace Period Unwrapped 2LD', () => {
})

test.describe('Grace Period Wrapped 2LD', () => {
test('Send feature', async ({ page, login, makeName, makePageObject }) => {
test('Send feature', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'grace-period-wrapped',
type: 'wrapped',
Expand All @@ -650,7 +647,6 @@ test.describe('Grace Period Wrapped 2LD', () => {
await ownershipPage.goto(name)
await login.connect()

await page.pause()
await expect(ownershipPage.sendNameButton).toHaveCount(0)
})

Expand Down Expand Up @@ -678,7 +674,7 @@ test.describe('Grace Period Wrapped 2LD', () => {
await expect(ownershipPage.syncManagerButton).toHaveCount(0)
})

test('Edit Roles', async ({ page, login, accounts, makeName, makePageObject }) => {
test('Edit Roles', async ({ login, accounts, makeName, makePageObject }) => {
const name = await makeName({
label: 'grace-period-wrapped',
type: 'wrapped',
Expand All @@ -691,7 +687,7 @@ test.describe('Grace Period Wrapped 2LD', () => {

await ownershipPage.goto(name)
await login.connect()
await page.pause()

await ownershipPage.editRolesButton.click()

await expect(editRolesModal.roleCardChangeButton('owner')).toHaveCount(0)
Expand Down
Loading

0 comments on commit ef50c58

Please sign in to comment.