diff --git a/e2e/specs/stateful/address.spec.ts b/e2e/specs/stateful/address.spec.ts index 3997ab815..4fce98112 100644 --- a/e2e/specs/stateful/address.spec.ts +++ b/e2e/specs/stateful/address.spec.ts @@ -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') diff --git a/e2e/specs/stateless/_importName.spec.ts b/e2e/specs/stateless/_importName.spec.ts index 55e9d7172..1c9c9de6f 100644 --- a/e2e/specs/stateless/_importName.spec.ts +++ b/e2e/specs/stateless/_importName.spec.ts @@ -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') @@ -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 @@ -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) @@ -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 @@ -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() @@ -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') @@ -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 @@ -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( @@ -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') diff --git a/e2e/specs/stateless/advancedEditor.spec.ts b/e2e/specs/stateless/advancedEditor.spec.ts index 1f4e770d1..ec83ed3a3 100644 --- a/e2e/specs/stateless/advancedEditor.spec.ts +++ b/e2e/specs/stateless/advancedEditor.spec.ts @@ -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') @@ -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( @@ -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(), ) diff --git a/e2e/specs/stateless/deleteSubname.spec.ts b/e2e/specs/stateless/deleteSubname.spec.ts index 094c294ed..25b4b61a8 100644 --- a/e2e/specs/stateless/deleteSubname.spec.ts +++ b/e2e/specs/stateless/deleteSubname.spec.ts @@ -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() diff --git a/e2e/specs/stateless/extendNames.spec.ts b/e2e/specs/stateless/extendNames.spec.ts index b13b390ee..5cf031d5e 100644 --- a/e2e/specs/stateless/extendNames.spec.ts +++ b/e2e/specs/stateless/extendNames.spec.ts @@ -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') @@ -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() @@ -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() @@ -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') @@ -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') diff --git a/e2e/specs/stateless/ownership.2LD.spec.ts b/e2e/specs/stateless/ownership.2LD.spec.ts index f4aa055c4..3910a0738 100644 --- a/e2e/specs/stateless/ownership.2LD.spec.ts +++ b/e2e/specs/stateless/ownership.2LD.spec.ts @@ -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', @@ -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, }) @@ -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) @@ -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', @@ -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) }) @@ -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', @@ -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) @@ -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', @@ -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) }) @@ -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', @@ -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) diff --git a/e2e/specs/stateless/ownership.3LD.spec.ts b/e2e/specs/stateless/ownership.3LD.spec.ts index 000cbef68..0d574db81 100644 --- a/e2e/specs/stateless/ownership.3LD.spec.ts +++ b/e2e/specs/stateless/ownership.3LD.spec.ts @@ -4,7 +4,7 @@ import { test } from '../../../playwright' import { testClient } from '../../../playwright/fixtures/contracts/utils/addTestContracts' test.describe('Unwrapped 3LD, Unwrapped 2LD - Parent 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: 'unwrapped', type: 'legacy', @@ -34,7 +34,6 @@ test.describe('Unwrapped 3LD, Unwrapped 2LD - Parent Owner and Manager', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await ownershipPage.sendNameButton.click() await sendNameModal.searchInput.fill(accounts.getAddress('user3')) await sendNameModal.searchResult(accounts.getAddress('user3')).click() @@ -1161,7 +1160,7 @@ test.describe('Wrapped 3LD - Wrapped 2LD - Parent Owner only', () => { }) test.describe('Wrapped 3LD, Unwrapped 2LD - Manager only', () => { - test('Send feature', async ({ page, login, accounts, makeName, makePageObject }) => { + test('Send feature', async ({ login, accounts, makeName, makePageObject }) => { const name = await makeName({ label: 'unwrapped', type: 'legacy', @@ -1193,7 +1192,6 @@ test.describe('Wrapped 3LD, Unwrapped 2LD - Manager only', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await ownershipPage.sendNameButton.click() await sendNameModal.searchInput.fill(accounts.getAddress('user3')) await sendNameModal.searchResult(accounts.getAddress('user3')).click() @@ -1390,7 +1388,6 @@ test.describe('Wrapped 3LD, Unwrapped 2LD - Parent only', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await page.waitForTimeout(2000) await expect(ownershipPage.sendNameButton).toHaveCount(0) await expect(ownershipPage.editRolesButton).toHaveCount(0) diff --git a/e2e/specs/stateless/ownership.4LD.spec.ts b/e2e/specs/stateless/ownership.4LD.spec.ts index 19ffef7c6..702de55a2 100644 --- a/e2e/specs/stateless/ownership.4LD.spec.ts +++ b/e2e/specs/stateless/ownership.4LD.spec.ts @@ -386,12 +386,7 @@ test.describe('Unwrapped 4LD, Unwrapped 3LD,2LD - Manager Only', () => { }) }) - test('Expiry Section, Extend & Set Reminder', async ({ - login, - makeName, - makePageObject, - page, - }) => { + test('Expiry Section, Extend & Set Reminder', async ({ login, makeName, makePageObject }) => { const name = await makeName({ label: 'unwrapped', type: 'legacy', @@ -424,7 +419,6 @@ test.describe('Unwrapped 4LD, Unwrapped 3LD,2LD - Manager Only', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await expect(ownershipPage.expiryPanelExpiry).toHaveCount(0) await expect(ownershipPage.expiryPanelGracePeriod).toHaveCount(0) @@ -683,7 +677,6 @@ test.describe('Unwrapped 4LD - Wrapped 3LD,2LD - Parent Owner only', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await page.waitForTimeout(2000) await expect(ownershipPage.sendNameButton).toHaveCount(0) await expect(ownershipPage.editRolesButton).toHaveCount(0) @@ -738,7 +731,7 @@ test.describe('Unwrapped 4LD - Wrapped 3LD,2LD - Parent Owner only', () => { }) test.describe('Unwrapped 4LD, Wrapped 3LD,2LD - Manager Only', () => { - test('Send feature', async ({ page, login, accounts, makeName, makePageObject }) => { + test('Send feature', async ({ login, accounts, makeName, makePageObject }) => { const name = await makeName({ label: 'unwrapped', type: 'wrapped', @@ -776,7 +769,6 @@ test.describe('Unwrapped 4LD, Wrapped 3LD,2LD - Manager Only', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await ownershipPage.sendNameButton.click() await sendNameModal.searchInput.fill(accounts.getAddress('user3')) await sendNameModal.searchResult(accounts.getAddress('user3')).click() diff --git a/e2e/specs/stateless/ownership.spec.ts b/e2e/specs/stateless/ownership.spec.ts index 332de2f35..50aa0cd55 100644 --- a/e2e/specs/stateless/ownership.spec.ts +++ b/e2e/specs/stateless/ownership.spec.ts @@ -328,7 +328,6 @@ test.describe('Send name', () => { }) test('should be able to send manager and eth-record if user is manager and not parent owner of unwrapped subname', async ({ - page, login, accounts, makeName, @@ -389,7 +388,7 @@ test.describe('Send name', () => { await expect(ownershipPage.roleRow(accounts.getAddress('user3'))).toContainText('manager', { timeout: 15000, }) - await page.pause() + await expect(ownershipPage.roleRow(accounts.getAddress('user2'))).toContainText('Parent owner') await expect(ownershipPage.roleRow(accounts.getAddress('user3'))).toContainText('ETH record') }) @@ -436,7 +435,6 @@ test.describe('Send name', () => { await profilePage.goto(subname) await login.connect() await expect(profilePage.record('text', 'nickname')).toContainText('test') - await page.pause() await ownershipPage.goto(subname) await ownershipPage.sendNameButton.click() @@ -460,7 +458,7 @@ test.describe('Send name', () => { await expect(ownershipPage.roleRow(accounts.getAddress('user3'))).toContainText('manager', { timeout: 15000, }) - await page.pause() + await expect(ownershipPage.roleRow(accounts.getAddress('user'))).toContainText('Parent owner') await expect(ownershipPage.roleRow('0x42D63ae25990889E35F215bC95884039Ba354115')).toContainText( 'ETH record', @@ -535,7 +533,7 @@ test.describe('Send name', () => { await expect(ownershipPage.roleRow(accounts.getAddress('user3'))).toContainText('manager', { timeout: 15000, }) - await page.pause() + await expect(ownershipPage.roleRow(accounts.getAddress('user2'))).toContainText('Parent owner') await expect(ownershipPage.roleRow(accounts.getAddress('user3'))).toContainText('ETH record') @@ -601,7 +599,6 @@ test.describe('Send name', () => { await sendNameModal.searchResult(accounts.getAddress('user3')).click() await sendNameModal.resetProfileSwitch.check() - await page.pause() // Should not be able to set owner because name is unwrapped // Should not be able to set eth record because user is not the manager // Should not be able to reset profile since old resolver does not support VersionableResolver @@ -657,7 +654,6 @@ test.describe('Edit roles: Happy ', () => { }) test('Should allow manager to change manager when they are not the owner', async ({ - page, login, accounts, makeName, @@ -682,7 +678,7 @@ test.describe('Edit roles: Happy ', () => { // Should not allow the manager to change the owner await expect(editRolesModal.roleCard('owner')).toHaveCount(0) await editRolesModal.roleCardChangeButton('manager').click() - await page.pause() + await editRolesModal.searchInput.fill(accounts.getAddress('user3')) await editRolesModal.searchResult(accounts.getAddress('user3')).click() await editRolesModal.saveButton.click() @@ -889,7 +885,6 @@ test.describe('Edit roles: Unwrapped subnames', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await page.waitForTimeout(2000) await expect(ownershipPage.sendNameButton).toHaveCount(0) @@ -932,7 +927,6 @@ test.describe('Edit roles: Unwrapped name', () => { test.describe('Edit roles: Wrapped subnames', () => { test('should allow namewrapper subname owner to send name', async ({ - page, login, accounts, makeName, @@ -959,7 +953,6 @@ test.describe('Edit roles: Wrapped subnames', () => { await ownershipPage.goto(subname) await login.connect() - await page.pause() await ownershipPage.editRolesButton.click() await editRolesModal.roleCardChangeButton('manager').click() @@ -1143,7 +1136,6 @@ test.describe('Extend name', () => { await ownershipPage.goto(name) await login.connect() - await page.pause() const timestamp = await ownershipPage.getExpiryTimestamp() diff --git a/e2e/specs/stateless/profileEditor.spec.ts b/e2e/specs/stateless/profileEditor.spec.ts index 77839e758..823c9cdb6 100644 --- a/e2e/specs/stateless/profileEditor.spec.ts +++ b/e2e/specs/stateless/profileEditor.spec.ts @@ -84,7 +84,7 @@ const makeRecords = async (overwrites: RecordOptions = {}): Promise { - test('should display profile records', async ({ page, login, makeName, makePageObject }) => { + test('should display profile records', async ({ login, makeName, makePageObject }) => { const name = await makeName({ label: 'profile', type: 'legacy', @@ -96,7 +96,6 @@ test.describe('profile', () => { await profilePage.goto(name) await login.connect() - await page.pause() await expect(profilePage.record('text', 'description')).toHaveText('Hello2') await expect(profilePage.record('text', 'url')).toHaveText('twitter.com') await expect(profilePage.record('address', 'btc')).toHaveText('bc1qj...pwa6n') @@ -126,7 +125,6 @@ test.describe('profile', () => { await expect(page).toHaveURL(`/${name}`) - await page.pause() await expect(profilePage.record('text', 'description')).toHaveText('Hello2') await expect(profilePage.record('text', 'url')).toHaveText('twitter.com') await expect(profilePage.record('address', 'btc')).toHaveText('bc1qj...pwa6n') @@ -196,7 +194,6 @@ test.describe('migrations', () => { }) test('should force a name with an unauthorised resolver to update their resolver', async ({ - page, login, makeName, makePageObject, @@ -215,7 +212,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect('user2') - await page.pause() await expect(morePage.resolver.getByText(ownedResolverAddress)).toBeVisible() @@ -231,7 +227,6 @@ test.describe('migrations', () => { }) test('should force a name with an invalid resolver to update their resolver', async ({ - page, login, makeName, makePageObject, @@ -250,7 +245,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(invalidResolverAddress)).toBeVisible() @@ -266,7 +260,6 @@ test.describe('migrations', () => { }) test('should force a wrapped name with a resolver that is not name wrapper aware to migrate update their resolver', async ({ - page, login, makeName, makePageObject, @@ -283,7 +276,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver).toHaveText(oldResolver) @@ -329,7 +321,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -350,7 +341,7 @@ test.describe('migrations', () => { await expect(morePage.resolver.getByText(newResolver)).toBeVisible() await recordsPage.goto(name) - await page.pause() + await expect(recordsPage.getRecordValue('text', 'email')).toHaveText('fakeemail@fake.com') await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('Hello2') await expect(recordsPage.getRecordValue('text', 'url')).toHaveText('https://twitter.com') @@ -399,7 +390,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -424,7 +414,7 @@ test.describe('migrations', () => { await expect(morePage.resolver.getByText(newResolver)).toBeVisible() await recordsPage.goto(name) - await page.pause() + await expect(page.getByTestId('text-amount')).toHaveText('0 Records') await expect(page.getByTestId('address-amount')).toHaveText('0 Records') await expect(page.getByText('No Content Hash')).toBeVisible() @@ -466,7 +456,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -484,7 +473,7 @@ test.describe('migrations', () => { await expect(morePage.resolver.getByText(newResolver)).toBeVisible() await recordsPage.goto(name) - await page.pause() + await expect(recordsPage.getRecordValue('text', 'email')).toHaveText('fakeemail@fake.com') await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('New profile') await expect(recordsPage.getRecordValue('text', 'url')).toHaveText('https://twitter.com') @@ -538,7 +527,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -547,7 +535,6 @@ test.describe('migrations', () => { await expect(page.getByText('Resolver out of sync')).toBeVisible() await profilePage.profileEditor.getByTestId('warning-overlay-next-button').click() - await page.pause() await page.getByTestId('migrate-profile-selector-current').check() await expect(page.getByTestId('migrate-profile-selector-current')).toBeChecked() await profilePage.profileEditor.getByTestId('warning-overlay-next-button').click() @@ -561,7 +548,7 @@ test.describe('migrations', () => { await expect(morePage.resolver.getByText(newResolver)).toBeVisible() await recordsPage.goto(name) - await page.pause() + await expect(page.getByTestId('text-amount')).toHaveText('3 Records') await expect(recordsPage.getRecordValue('text', 'email')).toHaveText('fakeemail@fake.com') await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('Hello2') @@ -615,7 +602,6 @@ test.describe('migrations', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -624,13 +610,10 @@ test.describe('migrations', () => { await expect(page.getByText('Resolver out of sync')).toBeVisible() await profilePage.profileEditor.getByTestId('warning-overlay-next-button').click() - await page.pause() await page.getByTestId('migrate-profile-selector-reset').check() await expect(page.getByTestId('migrate-profile-selector-reset')).toBeChecked() await profilePage.profileEditor.getByTestId('warning-overlay-next-button').click() - await page.pause() - await expect(page.getByText('Reset profile')).toBeVisible() await profilePage.profileEditor.getByTestId('warning-overlay-next-button').click() @@ -640,7 +623,7 @@ test.describe('migrations', () => { await expect(morePage.resolver.getByText(newResolver)).toBeVisible() await recordsPage.goto(name) - await page.pause() + await expect(page.getByTestId('text-amount')).toHaveText('0 Records') await expect(page.getByTestId('address-amount')).toHaveText('0 Records') await expect(page.getByText('No Content Hash')).toBeVisible() @@ -650,7 +633,6 @@ test.describe('migrations', () => { test.describe('unwrapped', () => { test('should be able to add/update profile records without migration', async ({ - page, login, makeName, makePageObject, @@ -670,7 +652,6 @@ test.describe('unwrapped', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -702,7 +683,6 @@ test.describe('unwrapped', () => { await morePage.goto(name) await expect(morePage.resolver).toHaveText(oldResolver) - await page.pause() await recordsPage.goto(name) await expect(recordsPage.getRecordValue('text', 'location')).toHaveText('L1 chain') await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('new name') @@ -737,7 +717,6 @@ test.describe('unwrapped', () => { await morePage.goto(name) await login.connect() - await page.pause() await expect(morePage.resolver.getByText(oldResolver)).toBeVisible() @@ -785,7 +764,6 @@ test.describe('unwrapped', () => { await morePage.goto(name) await expect(morePage.resolver).toHaveText(oldResolver) - await page.pause() await recordsPage.goto(name) await expect(page.getByTestId('text-amount')).toHaveText('0 Records') await expect(page.getByTestId('address-amount')).toHaveText('0 Records') @@ -796,7 +774,6 @@ test.describe('unwrapped', () => { test.describe('wrapped', () => { test('should be able to add/update profile records without migration', async ({ - page, login, makeName, makePageObject, @@ -814,7 +791,6 @@ test.describe('wrapped', () => { await profilePage.goto(name) await login.connect() - await page.pause() await expect(profilePage.record('text', 'description')).toHaveText('Hello2') await expect(profilePage.record('text', 'url')).toHaveText('twitter.com') @@ -838,7 +814,6 @@ test.describe('wrapped', () => { await transactionModal.autoComplete() - await page.pause() await recordsPage.goto(name) await expect(recordsPage.getRecordValue('text', 'location')).toHaveText('L1 chain') await expect(recordsPage.getRecordValue('text', 'description')).toHaveText('new name') @@ -871,7 +846,6 @@ test.describe('wrapped', () => { await profilePage.goto(name) await login.connect() - await page.pause() await expect(profilePage.record('text', 'description')).toHaveText('Hello2') await expect(profilePage.record('text', 'url')).toHaveText('twitter.com') @@ -911,7 +885,6 @@ test.describe('wrapped', () => { await transactionModal.autoComplete() - await page.pause() await recordsPage.goto(name) await expect(page.getByTestId('text-amount')).toHaveText('0 Records') await expect(page.getByTestId('address-amount')).toHaveText('0 Records') diff --git a/e2e/specs/stateless/registerName.spec.ts b/e2e/specs/stateless/registerName.spec.ts index 1b2209a93..d4ccb4326 100644 --- a/e2e/specs/stateless/registerName.spec.ts +++ b/e2e/specs/stateless/registerName.spec.ts @@ -388,7 +388,6 @@ test('should allow registering a name and resuming from the commit toast', async await page.goto(`/${name}/register`) await login.connect() - await page.pause() await page.getByTestId('payment-choice-ethereum').click() await page.getByTestId('primary-name-toggle').uncheck() await page.getByTestId('next-button').click() @@ -449,7 +448,6 @@ test('should allow registering with a specific date', async ({ page, login, make await calendar.fill(dateToDateInput(twoYearsAndHalfLater)) - await page.pause() await expect(page.getByTestId('calendar-date')).toHaveValue( dateToDateInput(twoYearsAndHalfLater), ) diff --git a/e2e/specs/stateless/setPrimary.spec.ts b/e2e/specs/stateless/setPrimary.spec.ts index df0bf6040..8237984eb 100644 --- a/e2e/specs/stateless/setPrimary.spec.ts +++ b/e2e/specs/stateless/setPrimary.spec.ts @@ -186,7 +186,7 @@ test.describe('profile', () => { await morePage.goto(subname) await login.connect() - await page.pause() + await expect(morePage.resolver).toContainText(UNAUTHORISED_RESOLVER) await profilePage.goto(subname) @@ -317,7 +317,7 @@ test.describe('profile', () => { await profilePage.goto(subname) await login.connect() - await page.pause() + // Assert state await expect(page.getByTestId('profile-title')).not.toContainText(subname) @@ -426,8 +426,6 @@ test.describe('profile', () => { await profilePage.goto(subname) await login.connect() - await page.pause() - // Assert state await expect(page.getByTestId('owner-profile-button-name.manager')).toContainText( accounts.getAddress('user', 5), @@ -482,8 +480,6 @@ test.describe('profile', () => { await profilePage.goto(name) await login.connect() - await page.pause() - await expect(page.getByTestId('profile-action-Set as primary name')).toHaveCount(0) // Assert state diff --git a/e2e/specs/stateless/verifications.spec.ts b/e2e/specs/stateless/verifications.spec.ts index f96b06b33..77e75b660 100644 --- a/e2e/specs/stateless/verifications.spec.ts +++ b/e2e/specs/stateless/verifications.spec.ts @@ -272,8 +272,6 @@ test.describe('Verified records', () => { await page.goto(`/${name}`) - await page.pause() - await expect(page.getByTestId('profile-section-verifications')).toBeVisible() await profilePage.isRecordVerified('text', 'com.twitter', false) @@ -347,8 +345,6 @@ test.describe('Verified records', () => { await page.goto(`/${name}`) - await page.pause() - await expect(page.getByTestId('profile-section-verifications')).toBeVisible() await profilePage.isRecordVerified('text', 'com.twitter', false) diff --git a/e2e/specs/stateless/wrapName.spec.ts b/e2e/specs/stateless/wrapName.spec.ts index a1d104e0d..607839564 100644 --- a/e2e/specs/stateless/wrapName.spec.ts +++ b/e2e/specs/stateless/wrapName.spec.ts @@ -131,7 +131,7 @@ test('should wrap name', async ({ makeName, login, makePageObject }) => { await expect(morePage.wrapButton).toHaveCount(0) }) -test('should allow wrapping a subdomain', async ({ page, makeName, login, makePageObject }) => { +test('should allow wrapping a subdomain', async ({ makeName, login, makePageObject }) => { const name = await makeName({ label: 'unwrapped-with-wrapped-subnames', type: 'legacy', @@ -158,8 +158,6 @@ test('should allow wrapping a subdomain', async ({ page, makeName, login, makePa await morePage.goto(subname) await login.connect() - await page.pause() - // should approve name wrapper for address await morePage.wrapButton.click() @@ -198,7 +196,6 @@ test('should allow wrapping a name with an unknown label', async ({ await morePage.goto(subname) await login.connect() - await page.pause() await morePage.wrapButton.click() const input = page.getByTestId(`unknown-label-input-${unknownLabelhash}`) diff --git a/src/components/@molecules/SearchInput/SearchInput.tsx b/src/components/@molecules/SearchInput/SearchInput.tsx index 770dd55d1..0d091ee4c 100644 --- a/src/components/@molecules/SearchInput/SearchInput.tsx +++ b/src/components/@molecules/SearchInput/SearchInput.tsx @@ -13,6 +13,7 @@ import { import { TFunction, useTranslation } from 'react-i18next' import useTransition, { TransitionState } from 'react-transition-state' import styled, { css } from 'styled-components' +import { match } from 'ts-pattern' import { Address, isAddress } from 'viem' import { useAccount, useChainId } from 'wagmi' @@ -343,17 +344,12 @@ const createSearchHandler = const path = getRouteForSearchItem({ address, chainId, queryClient, selectedItem }) - if (path === `/register/${text}`) { - trackEvent({ - eventName: 'search_selected_eth', - customProperties: { name: text }, - }) - } else if (path === `/dotbox/${text}`) { - trackEvent({ - eventName: 'search_selected_box', - customProperties: { name: text }, - }) - } + const eventName = match(path) + .with(`/register/${text}`, () => 'search_selected_eth' as const) + .with(`/dotbox/${text}`, () => 'search_selected_box' as const) + .with(`/import/${text}`, () => 'search_selected_dns' as const) + .otherwise(() => undefined) + if (eventName) trackEvent({ eventName, customProperties: { name: text } }) setInputVal('') searchInputRef.current?.blur() diff --git a/src/components/@molecules/TransactionDialogManager/stage/TransactionStageModal.tsx b/src/components/@molecules/TransactionDialogManager/stage/TransactionStageModal.tsx index 6620b1281..435f3b759 100644 --- a/src/components/@molecules/TransactionDialogManager/stage/TransactionStageModal.tsx +++ b/src/components/@molecules/TransactionDialogManager/stage/TransactionStageModal.tsx @@ -469,6 +469,15 @@ export const TransactionStageModal = ({ }, [helper]) const ActionButton = useMemo(() => { + const handleCompleteTransaction = () => { + dispatch({ name: 'incrementTransaction' }) + + if (actionName === 'approveDnsRegistrar') { + trackEvent({ + eventName: 'register_started_dns', + }) + } + } if (stage === 'complete') { const final = currentStep + 1 === stepCount @@ -486,7 +495,7 @@ export const TransactionStageModal = ({ return ( @@ -542,12 +551,14 @@ export const TransactionStageModal = ({ onClick={() => { sendTransaction(request!) - if (['commitName', 'registerName'].includes(actionName)) { - trackEvent({ - eventName: - actionName === 'commitName' ? 'commit_wallet_opened' : 'register_wallet_opened', - }) - } + const eventName = match(actionName) + .with('commitName', () => 'commit_wallet_opened' as const) + .with('registerName', () => 'register_wallet_opened' as const) + .with('approveDnsRegistrar', () => 'dns_approve_registrar_wallet_opened' as const) + .with('importDnsName', () => 'dns_import_wallet_opened' as const) + .with('claimDnsName', () => 'dns_claim_wallet_opened' as const) + .otherwise(() => undefined) + if (eventName) trackEvent({ eventName }) }} data-testid="transaction-modal-confirm-button" > diff --git a/src/components/pages/import/[name]/steps/onchain/ImportTransaction.tsx b/src/components/pages/import/[name]/steps/onchain/ImportTransaction.tsx index d27f5715a..1e9cc13d2 100644 --- a/src/components/pages/import/[name]/steps/onchain/ImportTransaction.tsx +++ b/src/components/pages/import/[name]/steps/onchain/ImportTransaction.tsx @@ -15,6 +15,7 @@ import { useDnsImportData } from '@app/hooks/ensjs/dns/useDnsImportData' import { useDnsOwner } from '@app/hooks/ensjs/dns/useDnsOwner' import { usePrimaryName } from '@app/hooks/ensjs/public/usePrimaryName' import { useApprovedForAll } from '@app/hooks/useApprovedForAll' +import { useEventTracker } from '@app/hooks/useEventTracker' import { useTransactionFlow } from '@app/transaction-flow/TransactionFlowProvider' import { UpdateCallback, useCallbackOnTransaction } from '@app/utils/SyncProvider/SyncProvider' import useUserConfig from '@app/utils/useUserConfig' @@ -105,6 +106,7 @@ export const ImportTransaction = ({ const { t } = useTranslation('dnssec', { keyPrefix: 'steps.transaction' }) const { t: tc } = useTranslation('common') + const { trackEvent } = useEventTracker() const { data: gasPrice } = useGasPrice() const { userConfig, setCurrency } = useUserConfig() const currencyDisplay = userConfig.currency === 'fiat' ? userConfig.fiat : 'eth' @@ -179,8 +181,18 @@ export const ImportTransaction = ({ const resumable = getResumable(key) const startOrResumeFlow = () => { - if (!item.started) dispatch({ name: 'setStarted', selected }) - if (resumable) return resumeTransactionFlow(key) + if (!item.started) { + trackEvent({ + eventName: 'dns_claim_started', + customProperties: { name: selected.name, importType: 'onchain' }, + }) + dispatch({ name: 'setStarted', selected }) + } + + if (resumable) { + return resumeTransactionFlow(key) + } + return createTransactionFlow(key, { transactions, resumable: true, @@ -189,7 +201,6 @@ export const ImportTransaction = ({ resumeLink: `/import/${selected.name}`, }) } - const txCallback: UpdateCallback = useCallback( ({ action, status, key: cbKey }) => { if (action !== 'claimDnsName' && action !== 'importDnsName') return diff --git a/src/components/pages/import/[name]/steps/onchain/VerifyOnchainOwnership.tsx b/src/components/pages/import/[name]/steps/onchain/VerifyOnchainOwnership.tsx index 17bfba790..eea61570d 100644 --- a/src/components/pages/import/[name]/steps/onchain/VerifyOnchainOwnership.tsx +++ b/src/components/pages/import/[name]/steps/onchain/VerifyOnchainOwnership.tsx @@ -96,6 +96,10 @@ export const VerifyOnchainOwnership = ({ return tc(`error.${errorKey}`, { ns: 'dnssec' }) }, [tc, error, isLoading]) + const handleStartDNSImport = () => { + dispatch({ name: 'increaseStep', selected }) + } + return ( {t('title')} @@ -160,7 +164,7 @@ export const VerifyOnchainOwnership = ({ {isConnected ? ( dispatch({ name: 'increaseStep', selected })} + onClick={handleStartDNSImport} data-testid="import-next-button" {...(dnsOwnerStatus === 'mismatching' ? { diff --git a/src/components/pages/import/[name]/useDnsImportReducer.ts b/src/components/pages/import/[name]/useDnsImportReducer.ts index 53406876b..24a5af4a2 100644 --- a/src/components/pages/import/[name]/useDnsImportReducer.ts +++ b/src/components/pages/import/[name]/useDnsImportReducer.ts @@ -1,7 +1,9 @@ import { useEffect } from 'react' +import { match } from 'ts-pattern' import { Address } from 'viem' import { useChainId } from 'wagmi' +import { TrackEventParameters, useEventTracker } from '@app/hooks/useEventTracker' import { useLocalStorageReducer } from '@app/hooks/useLocalStorage' import { isBrowser } from '@app/utils/utils' @@ -105,57 +107,74 @@ export const getSelectedIndex = (state: DnsImportReducerData, selected: Selected } /* eslint-disable no-param-reassign */ -const reducer = (state: DnsImportReducerData, action: DnsImportReducerAction) => { - let selectedItemInx = getSelectedIndex(state, action.selected) +const reducer = + ({ trackEvent }: { trackEvent: (event: TrackEventParameters) => void }) => + (state: DnsImportReducerData, action: DnsImportReducerAction) => { + let selectedItemInx = getSelectedIndex(state, action.selected) - if (!isBrowser) return + if (!isBrowser) return - if (selectedItemInx === -1) { - selectedItemInx = state.items.push(createDefaultData(action.selected)) - 1 - } + if (selectedItemInx === -1) { + selectedItemInx = state.items.push(createDefaultData(action.selected)) - 1 + } - const selectedItem = state.items[selectedItemInx] - - switch (action.name) { - case 'increaseStep': - selectedItem.stepIndex += 1 - break - case 'decreaseStep': - selectedItem.stepIndex -= 1 - break - case 'setSteps': - selectedItem.steps = action.payload - break - case 'setType': - selectedItem.type = action.payload - break - case 'setStarted': - selectedItem.started = true - break - case 'setAddress': - selectedItem.address = action.payload - break - case 'resetItem': - state.items[selectedItemInx] = createDefaultData(action.selected) - break - case 'clearItem': - state.items.splice(selectedItemInx, 1) - break - case 'cleanupNonMatching': - for (let i = 0; i < state.items.length; i += 1) { - const item = state.items[i] - if (item !== selectedItem && state.items[i].started === false) { - state.items.splice(i, 1) - i -= 1 - } + const selectedItem = state.items[selectedItemInx] + + switch (action.name) { + case 'increaseStep': { + const currentStep = selectedItem.steps[selectedItem.stepIndex] + + const eventName = match(currentStep) + .with('selectType', () => 'dns_selected_import_type' as const) + .with('enableDnssec', () => 'dns_sec_enabled' as const) + .with('verifyOnchainOwnership', () => 'dns_verified_ownership' as const) + .with('transaction', () => 'dns_claimed' as const) + .with('verifyOffchainOwnership', () => 'dns_claimed' as const) + .otherwise(() => undefined) + if (eventName) + trackEvent({ + eventName, + customProperties: { name: selectedItem.name, importType: selectedItem.type }, + }) + selectedItem.stepIndex += 1 + return state } - break - default: - break - } + case 'decreaseStep': + selectedItem.stepIndex -= 1 + break + case 'setSteps': + selectedItem.steps = action.payload + break + case 'setType': + selectedItem.type = action.payload + break + case 'setStarted': + selectedItem.started = true + break + case 'setAddress': + selectedItem.address = action.payload + break + case 'resetItem': + state.items[selectedItemInx] = createDefaultData(action.selected) + break + case 'clearItem': + state.items.splice(selectedItemInx, 1) + break + case 'cleanupNonMatching': + for (let i = 0; i < state.items.length; i += 1) { + const item = state.items[i] + if (item !== selectedItem && state.items[i].started === false) { + state.items.splice(i, 1) + i -= 1 + } + } + break + default: + break + } - return state -} + return state + } /* eslint-enable no-param-reassign */ export const useDnsImportReducer = ({ @@ -166,10 +185,11 @@ export const useDnsImportReducer = ({ name: string }) => { const chainId = useChainId() + const { trackEvent } = useEventTracker() const selected = { address: address || null, name, chainId } as SelectedItemProperties const [state, dispatch] = useLocalStorageReducer( 'dns-import', - reducer, + reducer({ trackEvent }), { items: [] }, ) diff --git a/src/hooks/useEventTracker.ts b/src/hooks/useEventTracker.ts index 6e45ea058..b7257638d 100644 --- a/src/hooks/useEventTracker.ts +++ b/src/hooks/useEventTracker.ts @@ -8,7 +8,7 @@ import useUserConfig from '@app/utils/useUserConfig' import { useChainName } from './chain/useChainName' type SearchSelectEvent = { - eventName: 'search_selected_eth' | 'search_selected_box' + eventName: 'search_selected_eth' | 'search_selected_box' | 'search_selected_dns' customProperties: { name: string } } @@ -23,6 +23,19 @@ type PaymentEvent = { } } +type DNSImportTypeSelectedEvent = { + eventName: + | 'dns_selected_import_type' + | 'dns_sec_enabled' + | 'dns_verified_ownership' + | 'dns_claim_started' + | 'dns_claimed' + customProperties: { + importType: 'onchain' | 'offchain' | null + name: string + } +} + type DefaultEvent = { eventName: | 'commit_started' @@ -30,11 +43,22 @@ type DefaultEvent = { | 'register_started' | 'register_started_box' | 'register_wallet_opened' + | 'claim_domain_started_dns' + | 'commit_wallet_opened_dns' + | 'register_started_dns' + | 'register_wallet_opened_dns' | 'register_override_triggered' + | 'dns_approve_registrar_wallet_opened' + | 'dns_import_wallet_opened' + | 'dns_claim_wallet_opened' customProperties?: never } -export type TrackEventParameters = SearchSelectEvent | PaymentEvent | DefaultEvent +export type TrackEventParameters = + | SearchSelectEvent + | PaymentEvent + | DefaultEvent + | DNSImportTypeSelectedEvent export const useEventTracker = () => { const chain = useChainName() @@ -43,7 +67,9 @@ export const useEventTracker = () => { const trackEvent = (props: TrackEventParameters) => { match(props) .with( - { eventName: P.union('search_selected_eth', 'search_selected_box') }, + { + eventName: P.union('search_selected_eth', 'search_selected_box', 'search_selected_dns'), + }, ({ eventName, customProperties }) => { const { name } = customProperties sendTrackEvent(eventName, chain, { name }) @@ -57,7 +83,14 @@ export const useEventTracker = () => { 'register_started', 'register_started_box', 'register_wallet_opened', + 'claim_domain_started_dns', + 'commit_wallet_opened_dns', + 'register_started_dns', + 'register_wallet_opened_dns', 'register_override_triggered', + 'dns_approve_registrar_wallet_opened', + 'dns_import_wallet_opened', + 'dns_claim_wallet_opened', ), }, ({ eventName }) => sendTrackEvent(eventName, chain), @@ -75,6 +108,21 @@ export const useEventTracker = () => { paymentAmount, }) }) + .with( + { + eventName: P.union( + 'dns_selected_import_type', + 'dns_sec_enabled', + 'dns_verified_ownership', + 'dns_claim_started', + 'dns_claimed', + ), + }, + ({ eventName, customProperties }) => { + const { importType, name } = customProperties + sendTrackEvent(eventName, chain, { name, importType }) + }, + ) .exhaustive() } diff --git a/src/transaction-flow/input/ProfileReclaim-flow.tsx b/src/transaction-flow/input/ProfileReclaim-flow.tsx index a71448ecb..407a0727e 100644 --- a/src/transaction-flow/input/ProfileReclaim-flow.tsx +++ b/src/transaction-flow/input/ProfileReclaim-flow.tsx @@ -85,7 +85,6 @@ const ProfileReclaim = ({ data: { name, label, parent }, dispatch, onDismiss }: errorForRecordAtIndex, isDirtyForRecordAtIndex, } = useProfileEditorForm(existingRecords) - console.log(existingRecords) const handleSubmit = () => { const payload = [ createTransactionItem('createSubname', {