From c44e2a7992422eb480398b0a7f4759768de975eb Mon Sep 17 00:00:00 2001 From: SagiSan Date: Mon, 2 Sep 2024 05:56:02 +0200 Subject: [PATCH] FET-1573 WIP deleteSubname in test --- deploy/00_register_legacy.ts | 18 +- e2e/specs/stateless/myNames.spec.ts | 679 +++++++++++++++++- package.json | 2 +- .../makeName/generators/deleteSubname.ts | 37 + .../generators/legacyNameGenerator.ts | 25 +- .../generators/wrappedNameGenerator.ts | 21 +- pnpm-lock.yaml | 253 ++----- .../@atoms/NameDetailItem/TaggedNameItem.tsx | 1 + .../NameTableHeader/NameTableHeader.tsx | 2 + 9 files changed, 823 insertions(+), 215 deletions(-) create mode 100644 playwright/fixtures/makeName/generators/deleteSubname.ts diff --git a/deploy/00_register_legacy.ts b/deploy/00_register_legacy.ts index 886248ac9..d65c75ff0 100644 --- a/deploy/00_register_legacy.ts +++ b/deploy/00_register_legacy.ts @@ -314,15 +314,15 @@ const names: Name[] = [ namedAddr: 'owner', subnames: [{ label: 'sub', namedOwner: 'owner' }], }, - { - label: 'unknown-labels', - namedOwner: 'owner', - namedAddr: 'owner', - subnames: [ - { label: 'aaa123xyz000', namedOwner: 'owner2' }, - { label: 'aaa123', namedOwner: 'owner' }, - ], - }, + // { + // label: 'unknown-labels', + // namedOwner: 'owner', + // namedAddr: 'owner', + // subnames: [ + // { label: 'aaa123xyz000', namedOwner: 'owner2' }, + // { label: 'aaa123', namedOwner: 'owner' }, + // ], + // }, { label: 'aaa123', namedOwner: 'owner', diff --git a/e2e/specs/stateless/myNames.spec.ts b/e2e/specs/stateless/myNames.spec.ts index 0c3ae97c5..4059bbef5 100644 --- a/e2e/specs/stateless/myNames.spec.ts +++ b/e2e/specs/stateless/myNames.spec.ts @@ -1,5 +1,13 @@ -import { expect } from '@playwright/test' -import { testClient } from '@root/playwright/fixtures/contracts/utils/addTestContracts' +import { expect, Locator, Page } from '@playwright/test' +import { + testClient, + waitForTransaction, + walletClient, +} from '@root/playwright/fixtures/contracts/utils/addTestContracts' +import { deleteSubnameFixture } from '@root/playwright/fixtures/makeName/generators/deleteSubname' +import { WrappedSubname } from '@root/playwright/fixtures/makeName/generators/generateWrappedSubname' +import { Address } from 'viem' +import { beforeAll } from 'vitest' import { test } from '../../../playwright' import { Name } from '../../../playwright/fixtures/makeName' @@ -35,3 +43,670 @@ test('myNames', async ({ page, login, makeName }) => { await page.pause() }) + +/// /// + +async function checkLinkText(locator: Locator, index: number, expectedText: string): Promise { + const text = await locator.nth(index).textContent() + expect(text).toContain(expectedText) +} + +async function scrollToBottom(page: Page): Promise { + await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)) +} + +async function waitForNamesToLoad(page: Page, order: string): Promise { + await page.waitForResponse(async (response) => { + const request = response.request() + + // Check if the request method is POST and the URL matches your endpoint + if (request.method() === 'POST' && request.url().includes('/subgraphs/name')) { + const postData = request.postData() + + // Parse the JSON payload to access the operationName + if (postData) { + const parsedData = JSON.parse(postData) + return ( + parsedData.operationName === 'getNamesForAddress' && + parsedData.variables.orderDirection === order + ) + } + } + + return false + }) +} + +test('Should display all expiry data', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Name[] = Array.from({ length: 20 }).map((_, i) => ({ + label: `wrapped-${i}`, + owner: 'user3', + type: 'wrapped', + duration: 3600 + i * 10, + })) + + const names = await makeName(temp) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + + expect(await nameLinks.count()).toBe(20) + for (let i = 0; i < 20; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } +}) + +test('Should display all expiry data (name-list > 20)', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Name[] = Array.from({ length: 30 }).map((_, i) => ({ + label: `wrapped-${i}`, + owner: 'user3', + type: 'wrapped', + duration: 3600 + i * 10, + })) + + const names = await makeName(temp) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 20; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(30) + for (let i = 20; i < 30; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } +}) + +test('Should display all expiry data (desc)', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Name[] = Array.from({ length: 30 }).map((_, i) => ({ + label: `wrapped-${i}`, + owner: 'user3', + type: 'wrapped', + duration: 3600 + i * 10, + })) + + const names = await makeName(temp) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 20; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(30) + for (let i = 20; i < 30; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await descButton.click() + await waitForNamesToLoad(page, 'desc') + + for (let i = 0; i < 20; i += 1) { + checkLinkText(nameLinks, i, names[29 - i]) + } + + expect(await nameLinks.count()).toBe(20) + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(30) + + for (let i = 20; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + await checkLinkText(nameLinks, i, names[29 - i]) + } +}) + +test('Should display all expiry data (no expiry time)', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Omit[] = Array.from({ length: 30 }).map( + (_, i) => ({ + label: `subname-${i}`, + owner: 'user3', + }), + ) + + const tempNames: Name = { + label: 'wrapped', + type: 'wrapped', + duration: 3600, + subnames: [...temp], + } + + await makeName(tempNames) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + const names = page.locator('.name-detail-item') + + await page.pause() + const fullText = (await names.nth(0).textContent()) as string + const trimmedText = `${fullText.split('.eth')[0]}.eth` + + const receipt = await deleteSubnameFixture(trimmedText) + expect(receipt.status).toBe('reverted') + expect(await nameLinks.count()).toBe(20) + for (let i = 0; i < 20; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + for (let i = 20; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + + await descButton.click() + + for (let i = 0; i < 20; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + expect(await nameLinks.count()).toBe(20) + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + for (let i = 20; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + + expect(await nameLinks.count()).toBe(30) + + await page.pause() + + // const receipt = await deleteSubnameFixture(trimmedText) + // expect(receipt.status).toBe('success') +}) + +test('Should display all expiry data (10 same expiry)', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Name[] = Array.from({ length: 30 }).map((_, i) => ({ + label: `wrapped-${i}`, + owner: 'user3', + type: 'wrapped', + duration: i < 10 ? 3600 : 3600 + i * 10, + })) + + const names = await makeName(temp) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 10; i += 1) { + expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } + for (let i = 10; i < 20; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(30) + for (let i = 20; i < 30; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await descButton.click() + + for (let i = 0; i < 20; i += 1) { + checkLinkText(nameLinks, i, names[29 - i]) + } + + expect(await nameLinks.count()).toBe(20) + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(30) + + for (let i = 20; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + await expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } +}) + +test('Should display all expiry data (30 same expiry)', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Name[] = Array.from({ length: 44 }).map((_, i) => ({ + label: `wrapped-${i}`, + owner: 'user3', + type: 'wrapped', + duration: i < 30 ? 3600 : 3600 + i * 10, + })) + + const names = await makeName(temp) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 20; i += 1) { + expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(40) + + for (let i = 20; i < 30; i += 1) { + expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } + for (let i = 30; i < 40; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await scrollToBottom(page) + + for (let i = 40; i < 44; i += 1) { + // eslint-disable-next-line no-await-in-loop + await checkLinkText(nameLinks, i, names[i]) + } + + await descButton.click() + await waitForNamesToLoad(page, 'desc') + + for (let i = 0; i <= 10; i += 1) { + checkLinkText(nameLinks, i, names[43 - i]) + } + + expect(await nameLinks.count()).toBe(20) + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(40) + + await scrollToBottom(page) + await page.waitForFunction( + () => { + const elements = document.querySelectorAll('[data-testid="names-list"] div div a') + return elements.length === 44 + }, + { timeout: 15000 }, + ) + expect(await nameLinks.count()).toBe(44) + + for (let i = 20; i < 44; i += 1) { + // eslint-disable-next-line no-await-in-loop + await expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } +}) + +test('Should display all expiry data (30 same expiry, legacy)', async ({ + page, + login, + makeName, +}) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Name[] = Array.from({ length: 44 }).map((_, i) => ({ + label: `legacy-${i}`, + owner: 'user3', + type: 'legacy', + duration: i < 30 ? 3600 : 3600 + i * 10, + })) + + const names = await makeName(temp) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + + await page.pause() + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 20; i += 1) { + expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(40) + + for (let i = 20; i < 30; i += 1) { + expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } + for (let i = 30; i < 40; i += 1) { + checkLinkText(nameLinks, i, names[i]) + } + + await scrollToBottom(page) + + for (let i = 40; i < 44; i += 1) { + // eslint-disable-next-line no-await-in-loop + await checkLinkText(nameLinks, i, names[i]) + } + + await descButton.click() + await waitForNamesToLoad(page, 'desc') + + for (let i = 0; i <= 10; i += 1) { + checkLinkText(nameLinks, i, names[43 - i]) + } + + expect(await nameLinks.count()).toBe(20) + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(40) + + await scrollToBottom(page) + await page.waitForFunction( + () => { + const elements = document.querySelectorAll('[data-testid="names-list"] div div a') + return elements.length === 44 + }, + { timeout: 15000 }, + ) + expect(await nameLinks.count()).toBe(44) + + for (let i = 20; i < 44; i += 1) { + // eslint-disable-next-line no-await-in-loop + await expect(page.getByText(`${names[i]}`)).toBeVisible({ timeout: 15000 }) + } +}) + +test('Should display all expiry data (30 same expiry, subnames)', async ({ + page, + login, + makeName, +}) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Omit[] = Array.from({ length: 30 }).map( + (_, i) => ({ + label: `subname-${i}`, + owner: 'user3', + duration: 3600 * 3600, // set to high => default to parent duration (result is same expiry date for all subnames) + fuses: { + parent: { + named: ['PARENT_CANNOT_CONTROL'], + }, + }, + }), + ) + const temp2: Omit[] = Array.from({ length: 14 }).map( + (_, i) => ({ + label: `subname-${i}`, + owner: 'user3', + duration: 3600 * 24 * 30 * 3 + i, + fuses: { + parent: { + named: ['PARENT_CANNOT_CONTROL'], + }, + }, + }), + ) + const tempNames: Name[] = [ + { + label: 'wrapped', + type: 'wrapped', + duration: -3600, + fuses: { + named: ['CANNOT_UNWRAP'], + }, + subnames: [...temp], + }, + { + label: 'wrapped-2nd', + type: 'wrapped', + duration: 3600 * 24 * 30 * 4, + fuses: { + named: ['CANNOT_UNWRAP'], + }, + subnames: [...temp2], + }, + ] + + await makeName(tempNames) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + + // await page.pause() + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 20; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(40) + + for (let i = 20; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + for (let i = 30; i < 40; i += 1) { + checkLinkText(nameLinks, i, `subname-${i - 30}.wrapped-2nd`) + } + + await scrollToBottom(page) + + for (let i = 40; i < 44; i += 1) { + // eslint-disable-next-line no-await-in-loop + await checkLinkText(nameLinks, i, `subname-${i - 30}.wrapped-2nd`) + } + + await descButton.click() + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(20) + + for (let i = 0; i < 14; i += 1) { + checkLinkText(nameLinks, i, `subname-${13 - i}.wrapped-2nd`) + } + + for (let i = 14; i < 20; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(40) + + for (let i = 20; i < 40; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } + + await scrollToBottom(page) + await page.waitForFunction( + () => { + const elements = document.querySelectorAll('[data-testid="names-list"] div div a') + return elements.length === 44 + }, + { timeout: 15000 }, + ) + expect(await nameLinks.count()).toBe(44) + + for (let i = 40; i < 44; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped/) + } +}) + +test('Should display all expiry data (mix expiry/no expiry)', async ({ page, login, makeName }) => { + await testClient.increaseTime({ seconds: 3 * 365 * 24 * 60 * 60 }) + await testClient.mine({ blocks: 1 }) + + const temp: Omit[] = Array.from({ length: 20 }).map( + (_, i) => ({ + label: `subname-${i}`, + owner: 'user3', + }), + ) + + const temp2: Omit[] = Array.from({ length: 10 }).map( + (_, i) => ({ + label: `subname-${i}`, + owner: 'user3', + duration: 3600 + i, + fuses: { + parent: { + named: ['PARENT_CANNOT_CONTROL'], + }, + }, + }), + ) + + const tempNames: Name[] = [ + { + label: 'wrapped-no-expiry', + type: 'wrapped', + duration: 3600, + subnames: [...temp], + }, + { + label: 'wrapped-expiry', + type: 'wrapped', + duration: 3600, + fuses: { + named: ['CANNOT_UNWRAP'], + }, + subnames: [...temp2], + }, + ] + + await makeName(tempNames) + + await page.goto('/') + await login.connect('user3') + await page.goto('/my/names') + + await page.waitForSelector('[data-testid="names-list"]') + + const nameLinks = page.locator('[data-testid="names-list"] div div a') + const descButton = page.locator('[data-testid="direction-button-desc"]') + + expect(await nameLinks.count()).toBe(20) + await page.pause() + for (let i = 0; i < 10; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped-expiry/) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'asc') + + expect(await nameLinks.count()).toBe(30) + + for (let i = 10; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped-no-expiry/) + } + + await descButton.click() + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(20) + for (let i = 0; i < 20; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped-no-expiry/) + } + + await scrollToBottom(page) + await waitForNamesToLoad(page, 'desc') + + expect(await nameLinks.count()).toBe(30) + + for (let i = 20; i < 30; i += 1) { + // eslint-disable-next-line no-await-in-loop + expect(await nameLinks.nth(i).textContent()).toMatch(/subname-\d+\.wrapped-expiry/) + } +}) diff --git a/package.json b/package.json index 3c154ea3d..2742fa9b0 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@ensdomains/address-encoder": "1.1.1", "@ensdomains/content-hash": "^3.0.0-beta.5", "@ensdomains/ens-contracts": "1.2.0-beta.0", - "@ensdomains/ensjs": "4.0.0", + "@ensdomains/ensjs": "workspace:*", "@ensdomains/thorin": "0.6.50", "@metamask/mobile-provider": "^2.1.0", "@metamask/post-message-stream": "^6.1.2", diff --git a/playwright/fixtures/makeName/generators/deleteSubname.ts b/playwright/fixtures/makeName/generators/deleteSubname.ts new file mode 100644 index 000000000..7f97ce9f2 --- /dev/null +++ b/playwright/fixtures/makeName/generators/deleteSubname.ts @@ -0,0 +1,37 @@ +/* eslint-disable import/no-extraneous-dependencies */ + +/* eslint-disable no-await-in-loop */ +// import { toUtf8Bytes } from '@ethersproject/strings/lib/utf8' + +import { Address } from 'viem' + +import { RecordOptions } from '@ensdomains/ensjs/utils' +import { deleteSubname } from '@ensdomains/ensjs/wallet' + +import { Accounts, User } from '../../accounts' +import { waitForTransaction, walletClient } from '../../contracts/utils/addTestContracts.js' + +type Dependencies = { + accounts: Accounts +} + +type Input = { + name: string + owner: User + resolver?: `0x${string}` + records?: RecordOptions +} + +export const deleteSubnameFixture = async (name: string) => { + let accounts: Address[] + accounts = await walletClient.getAddresses() + console.log(accounts[2]) + const tx = await deleteSubname(walletClient, { + name, + contract: 'registry', + account: accounts[2], + }) + const receipt = await waitForTransaction(tx) + console.log(receipt) + return receipt +} diff --git a/playwright/fixtures/makeName/generators/legacyNameGenerator.ts b/playwright/fixtures/makeName/generators/legacyNameGenerator.ts index cb7a962c7..4655921e5 100644 --- a/playwright/fixtures/makeName/generators/legacyNameGenerator.ts +++ b/playwright/fixtures/makeName/generators/legacyNameGenerator.ts @@ -19,10 +19,10 @@ import { walletClient, } from '../../contracts/utils/addTestContracts.js' import { Provider } from '../../provider.js' -import { generateLegacySubname, LegacySubname } from './generateLegacySubname.js' import { legacyEthRegistrarControllerAbi } from '../constants/abis.js' -import { Name } from '../index'; +import { Name } from '../index' import { getLegacyRentPrice } from '../utils/getLegacyRentPrice.js' +import { generateLegacySubname, LegacySubname } from './generateLegacySubname.js' const DEFAULT_DURATION = 31536000 @@ -66,7 +66,7 @@ export const makeLegacyNameGenerator = ({ provider, accounts, contracts }: Depen functionName: 'makeCommitment', abi: legacyEthRegistrarControllerAbi, args: [label, ownerAddress, secret], - }) + }), }) const preparedTransaction = await walletClient.prepareTransactionRequest({ @@ -87,7 +87,7 @@ export const makeLegacyNameGenerator = ({ provider, accounts, contracts }: Depen const ownerAddress = accounts.getAddress(owner) - const price = await getLegacyRentPrice({ label, duration}) + const price = await getLegacyRentPrice({ label, duration }) const preparedTransaction = await walletClient.prepareTransactionRequest({ to: walletClient.chain.contracts.legacyRegistrarController.address, @@ -106,14 +106,21 @@ export const makeLegacyNameGenerator = ({ provider, accounts, contracts }: Depen configure: async (nameConfig: LegacyName) => { const { label, owner, manager, subnames = [], secret } = nameWithDefaults(nameConfig) const name = `${label}.eth` - // Create subnames - await Promise.all(subnames.map((subname) => { - return generateLegacySubname({ accounts, contracts })({ + // Create subnames + // await Promise.all(subnames.map((subname) => { + // return generateLegacySubname({ accounts, contracts })({ + // ...subname, + // name: `${label}.eth`, + // nameOwner: owner + // }) + // })) + for (let subname of subnames) { + return await generateLegacySubname({ accounts, contracts })({ ...subname, name: `${label}.eth`, - nameOwner: owner + nameOwner: owner, }) - })) + } if (!!manager && manager !== owner) { console.log('setting manager:', name, manager) diff --git a/playwright/fixtures/makeName/generators/wrappedNameGenerator.ts b/playwright/fixtures/makeName/generators/wrappedNameGenerator.ts index 99aa5987c..9f92fdf2f 100644 --- a/playwright/fixtures/makeName/generators/wrappedNameGenerator.ts +++ b/playwright/fixtures/makeName/generators/wrappedNameGenerator.ts @@ -159,12 +159,21 @@ export const makeWrappedNameGenerator = ({ accounts, provider, contracts }: Depe }) } - await Promise.all(subnames.map((subname) => generateWrappedSubname({ accounts, provider, contracts})({ - ...subname, - name: `${label}.eth`, - nameOwner: owner, - resolver: subname.resolver ?? _resolver - }))) + // await Promise.all(subnames.map((subname) => generateWrappedSubname({ accounts, provider, contracts})({ + // ...subname, + // name: `${label}.eth`, + // nameOwner: owner, + // resolver: subname.resolver ?? _resolver + // }))) + + for (const subname of subnames) { + await generateWrappedSubname({ accounts, provider, contracts })({ + ...subname, + name: `${label}.eth`, + nameOwner: owner, + resolver: subname.resolver ?? _resolver, + }); + } if (!hasValidResolver && resolver) { console.log('setting resolver: ', name, resolver) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d9b5bcd5..c3a904ad6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ importers: specifier: 1.2.0-beta.0 version: 1.2.0-beta.0 '@ensdomains/ensjs': - specifier: 4.0.0 - version: 4.0.0(encoding@0.1.13)(typescript@5.4.5)(viem@2.19.4(bufferutil@4.0.7)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8))(zod@3.23.8) + specifier: workspace:* + version: link:.yalc/@ensdomains/ensjs '@ensdomains/thorin': specifier: 0.6.50 version: 0.6.50(react-dom@18.3.1(react@18.3.1))(react-transition-state@1.1.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)(styled-components@5.3.11(@babel/core@7.24.6)(react-dom@18.3.1(react@18.3.1))(react-is@17.0.2)(react@18.3.1)) @@ -482,40 +482,7 @@ importers: version: 2.1.0 viem: specifier: ^2.9.2 - version: 2.19.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8) - - .yalc/@ensdomains/thorin: - dependencies: - '@types/jest': - specifier: ^29.5.12 - version: 29.5.12 - clsx: - specifier: ^1.1.1 - version: 1.2.1 - focus-visible: - specifier: ^5.2.0 - version: 5.2.0 - jest-babel: - specifier: ^1.0.1 - version: 1.0.1(babel-core@7.0.0-bridge.0(@babel/core@7.24.6)) - lodash: - specifier: ^4.17.21 - version: 4.17.21 - react: - specifier: ^18.2.0 - version: 18.3.1 - react-dom: - specifier: ^18.2.0 - version: 18.3.1(react@18.3.1) - react-transition-state: - specifier: ^2.1.1 - version: 2.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - styled-components: - specifier: ^5.3.6 - version: 5.3.11(@babel/core@7.24.6)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1) - ts-pattern: - specifier: ^4.3.0 - version: 4.3.0 + version: 2.19.4(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8) packages: @@ -1663,11 +1630,6 @@ packages: '@ensdomains/ensjs@2.1.0': resolution: {integrity: sha512-GRbGPT8Z/OJMDuxs75U/jUNEC0tbL0aj7/L/QQznGYKm/tiasp+ndLOaoULy9kKJFC0TBByqfFliEHDgoLhyog==} - '@ensdomains/ensjs@4.0.0': - resolution: {integrity: sha512-iI6ieuP0TeSK46JCP21EGxyup5rPE5rMmDMTrpRs+u3iwk42Bx3e4oG5sEtTRmxnXFO9uaSqk+WSXEMcHyPKxQ==} - peerDependencies: - viem: ^2.9.2 - '@ensdomains/resolver@0.2.4': resolution: {integrity: sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA==} deprecated: Please use @ensdomains/ens-contracts @@ -6662,12 +6624,6 @@ packages: iterator.prototype@1.1.2: resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} - jest-babel@1.0.1: - resolution: {integrity: sha512-hZp74w14Rbv9zqkyrVEUBiGpjE3DvG8qmMDI5qblVhDe5TCjDzJYOHGUcousz+tJrTtHB1im29xS3cZUyhLnAg==} - deprecated: jest-babel is outdated and useless now, try to move to babel-jest package - peerDependencies: - babel-core: '>= 5.5.0 < 6' - jest-canvas-mock@2.5.2: resolution: {integrity: sha512-vgnpPupjOL6+L5oJXzxTxFrlGEIbHdZqFU+LFNdtLxZ3lRDCl17FlTMM7IatoRQkrcyOTMlDinjUguqmQ6bR2A==} @@ -8391,12 +8347,6 @@ packages: react: ^18.2.0 react-dom: ^18.2.0 - react-transition-state@2.1.1: - resolution: {integrity: sha512-kQx5g1FVu9knoz1T1WkapjUgFz08qQ/g1OmuWGi3/AoEFfS0kStxrPlZx81urjCXdz2d+1DqLpU6TyLW/Ro04Q==} - peerDependencies: - react: ^18.2.0 - react-dom: ^18.2.0 - react-universal-interface@0.6.2: resolution: {integrity: sha512-dg8yXdcQmvgR13RIlZbTRQOoUrDciFVoSBZILwjE2LFISxZZ8loVJKAkuzswl5js8BHda79bIb2b84ehU8IjXw==} peerDependencies: @@ -9814,14 +9764,6 @@ packages: resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==} engines: {'0': node >=0.6.0} - viem@2.19.0: - resolution: {integrity: sha512-3UYVzNHhXW6Fug/di4IpISWDUACFEo4CHR+/BgmiNwzEQ/1mskBAsoTjfF5WdWUMeq0HGTGyzjNKipxsak5Jbw==} - peerDependencies: - typescript: '>=5.0.4' - peerDependenciesMeta: - typescript: - optional: true - viem@2.19.4: resolution: {integrity: sha512-JdhK3ui3uPD2tnpqGNkJaDQV4zTfOeKXcF+VrU8RG88Dn2e0lFjv6l7m0YNmYLsHm+n5vFFfCLcUrTk6xcYv5w==} peerDependencies: @@ -10582,10 +10524,10 @@ snapshots: '@babel/helpers': 7.24.6 '@babel/parser': 7.24.6 '@babel/template': 7.24.6 - '@babel/traverse': 7.24.6 + '@babel/traverse': 7.24.6(supports-color@5.5.0) '@babel/types': 7.24.6 convert-source-map: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -10679,7 +10621,7 @@ snapshots: '@babel/core': 7.24.6 '@babel/helper-compilation-targets': 7.24.6 '@babel/helper-plugin-utils': 7.24.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -11753,21 +11695,6 @@ snapshots: '@babel/parser': 7.25.3 '@babel/types': 7.25.2 - '@babel/traverse@7.24.6': - dependencies: - '@babel/code-frame': 7.24.6 - '@babel/generator': 7.24.6 - '@babel/helper-environment-visitor': 7.24.6 - '@babel/helper-function-name': 7.24.6 - '@babel/helper-hoist-variables': 7.24.6 - '@babel/helper-split-export-declaration': 7.24.6 - '@babel/parser': 7.24.6 - '@babel/types': 7.24.6 - debug: 4.3.4(supports-color@8.1.1) - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - '@babel/traverse@7.24.6(supports-color@5.5.0)': dependencies: '@babel/code-frame': 7.24.6 @@ -11974,23 +11901,6 @@ snapshots: - bufferutil - utf-8-validate - '@ensdomains/ensjs@4.0.0(encoding@0.1.13)(typescript@5.4.5)(viem@2.19.4(bufferutil@4.0.7)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8))(zod@3.23.8)': - dependencies: - '@adraffy/ens-normalize': 1.10.1 - '@ensdomains/address-encoder': 1.1.1 - '@ensdomains/content-hash': 3.1.0-rc.1 - '@ensdomains/dnsprovejs': 0.5.1 - abitype: 1.0.5(typescript@5.4.5)(zod@3.23.8) - dns-packet: 5.6.1 - graphql: 16.8.1 - graphql-request: 6.1.0(encoding@0.1.13)(graphql@16.8.1) - pako: 2.1.0 - viem: 2.19.4(bufferutil@4.0.7)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8) - transitivePeerDependencies: - - encoding - - typescript - - zod - '@ensdomains/resolver@0.2.4': {} '@ensdomains/solsha1@0.0.3': @@ -12163,7 +12073,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -12486,7 +12396,7 @@ snapshots: '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -12500,7 +12410,7 @@ snapshots: '@babel/core': 7.24.6 '@babel/generator': 7.24.6 '@babel/parser': 7.24.6 - '@babel/traverse': 7.24.6 + '@babel/traverse': 7.24.6(supports-color@5.5.0) '@babel/types': 7.24.6 prettier: 3.0.3 semver: 7.6.2 @@ -12525,6 +12435,7 @@ snapshots: '@jest/expect-utils@29.7.0': dependencies: jest-get-type: 29.6.3 + optional: true '@jest/fake-timers@29.7.0': dependencies: @@ -12734,7 +12645,7 @@ snapshots: bufferutil: 4.0.8 cross-fetch: 4.0.0(encoding@0.1.13) date-fns: 2.30.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eciesjs: 0.3.18 eventemitter2: 6.4.9 readable-stream: 3.6.2 @@ -12762,7 +12673,7 @@ snapshots: '@types/dom-screen-wake-lock': 1.0.3 bowser: 2.11.0 cross-fetch: 4.0.0(encoding@0.1.13) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eciesjs: 0.3.18 eth-rpc-errors: 4.0.3 eventemitter2: 6.4.9 @@ -12791,7 +12702,7 @@ snapshots: '@metamask/utils@3.6.0': dependencies: '@types/debug': 4.1.12 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) semver: 7.6.2 superstruct: 1.0.4 transitivePeerDependencies: @@ -12801,7 +12712,7 @@ snapshots: dependencies: '@ethereumjs/tx': 4.2.0 '@types/debug': 4.1.12 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) semver: 7.6.2 superstruct: 1.0.4 transitivePeerDependencies: @@ -12813,7 +12724,7 @@ snapshots: '@noble/hashes': 1.4.0 '@scure/base': 1.1.6 '@types/debug': 4.1.12 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) pony-cause: 2.1.11 semver: 7.6.2 superstruct: 1.0.4 @@ -12876,7 +12787,7 @@ snapshots: '@open-draft/until': 1.0.3 '@types/debug': 4.1.12 '@xmldom/xmldom': 0.8.10 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) headers-polyfill: 3.2.5 outvariant: 1.4.2 strict-event-emitter: 0.2.8 @@ -13143,7 +13054,7 @@ snapshots: '@puppeteer/browsers@2.2.3': dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) extract-zip: 2.0.1 progress: 2.0.3 proxy-agent: 6.4.0 @@ -14022,7 +13933,7 @@ snapshots: big.js: 6.2.1 bn.js: 5.2.1 cbor: 5.2.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) lodash: 4.17.21 semver: 7.6.2 utf8: 3.0.0 @@ -14038,7 +13949,7 @@ snapshots: '@truffle/contract-schema@3.4.16': dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -14051,7 +13962,7 @@ snapshots: '@truffle/error': 0.2.2 '@truffle/interface-adapter': 0.5.37(bufferutil@4.0.7)(encoding@0.1.13)(utf-8-validate@6.0.3) bignumber.js: 7.2.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) ethers: 4.0.49 web3: 1.10.0(bufferutil@4.0.7)(encoding@0.1.13)(utf-8-validate@6.0.3) web3-core-helpers: 1.10.0 @@ -14070,7 +13981,7 @@ snapshots: '@trufflesuite/chromafi': 3.0.0 bn.js: 5.2.1 chalk: 2.4.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) highlightjs-solidity: 2.0.6 transitivePeerDependencies: - supports-color @@ -14200,6 +14111,7 @@ snapshots: dependencies: expect: 29.7.0 pretty-format: 29.7.0 + optional: true '@types/js-cookie@2.2.7': {} @@ -14354,7 +14266,7 @@ snapshots: '@typescript-eslint/type-utils': 6.21.0(eslint@8.50.0)(typescript@5.4.5) '@typescript-eslint/utils': 6.21.0(eslint@8.50.0)(typescript@5.4.5) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.50.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -14372,7 +14284,7 @@ snapshots: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.50.0 optionalDependencies: typescript: 5.4.5 @@ -14398,7 +14310,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) '@typescript-eslint/utils': 6.21.0(eslint@8.50.0)(typescript@5.4.5) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) eslint: 8.50.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: @@ -14416,7 +14328,7 @@ snapshots: dependencies: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 @@ -14430,7 +14342,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -14445,7 +14357,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.10.0 '@typescript-eslint/visitor-keys': 7.10.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -14550,7 +14462,7 @@ snapshots: dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.4 @@ -15118,13 +15030,13 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color agent-base@7.1.1: dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -15431,17 +15343,6 @@ snapshots: transitivePeerDependencies: - '@babel/core' - babel-plugin-styled-components@2.1.4(@babel/core@7.24.6)(styled-components@5.3.11(@babel/core@7.24.6)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)): - dependencies: - '@babel/helper-annotate-as-pure': 7.24.6 - '@babel/helper-module-imports': 7.24.6 - '@babel/plugin-syntax-jsx': 7.24.6(@babel/core@7.24.6) - lodash: 4.17.21 - picomatch: 2.3.1 - styled-components: 5.3.11(@babel/core@7.24.6)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1) - transitivePeerDependencies: - - '@babel/core' - babel-plugin-transform-flow-enums@0.0.2(@babel/core@7.24.6): dependencies: '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.24.6) @@ -15716,7 +15617,7 @@ snapshots: capnp-ts@0.7.0: dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) tslib: 2.6.2 transitivePeerDependencies: - supports-color @@ -16548,7 +16449,7 @@ snapshots: engine.io-client@6.5.3(bufferutil@4.0.7)(utf-8-validate@6.0.3): dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) engine.io-parser: 5.2.2 ws: 8.11.0(bufferutil@4.0.7)(utf-8-validate@6.0.3) xmlhttprequest-ssl: 2.0.0 @@ -16852,7 +16753,7 @@ snapshots: eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.50.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.50.0): dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) enhanced-resolve: 5.16.1 eslint: 8.50.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@6.21.0(eslint@8.50.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.21.0(eslint@8.50.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1)(eslint@8.50.0))(eslint@8.50.0) @@ -17004,7 +16905,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -17300,6 +17201,7 @@ snapshots: jest-matcher-utils: 29.7.0 jest-message-util: 29.7.0 jest-util: 29.7.0 + optional: true exponential-backoff@3.1.1: {} @@ -17360,7 +17262,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -17518,7 +17420,7 @@ snapshots: follow-redirects@1.15.6(debug@4.3.4): optionalDependencies: - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) for-each@0.3.3: dependencies: @@ -17698,7 +17600,7 @@ snapshots: dependencies: basic-ftp: 5.0.5 data-uri-to-buffer: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) fs-extra: 11.2.0 transitivePeerDependencies: - supports-color @@ -17901,7 +17803,7 @@ snapshots: axios: 0.21.4(debug@4.3.4) chalk: 4.1.2 chokidar: 3.6.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) enquirer: 2.4.1 ethers: 5.7.2(bufferutil@4.0.7)(utf-8-validate@6.0.3) form-data: 4.0.0 @@ -17934,7 +17836,7 @@ snapshots: chalk: 2.4.2 chokidar: 3.6.0 ci-info: 2.0.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) enquirer: 2.4.1 env-paths: 2.2.1 ethereum-cryptography: 1.2.0 @@ -18104,7 +18006,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -18129,14 +18031,14 @@ snapshots: https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.4: dependencies: agent-base: 7.1.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -18502,7 +18404,7 @@ snapshots: istanbul-lib-source-maps@5.0.4: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -18520,10 +18422,6 @@ snapshots: reflect.getprototypeof: 1.0.6 set-function-name: 2.0.2 - jest-babel@1.0.1(babel-core@7.0.0-bridge.0(@babel/core@7.24.6)): - dependencies: - babel-core: 7.0.0-bridge.0(@babel/core@7.24.6) - jest-canvas-mock@2.5.2: dependencies: cssfontparser: 1.2.1 @@ -18535,6 +18433,7 @@ snapshots: diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 + optional: true jest-environment-node@29.7.0: dependencies: @@ -18553,10 +18452,11 @@ snapshots: jest-diff: 29.7.0 jest-get-type: 29.6.3 pretty-format: 29.7.0 + optional: true jest-message-util@29.7.0: dependencies: - '@babel/code-frame': 7.24.6 + '@babel/code-frame': 7.24.7 '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 @@ -18575,7 +18475,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 18.19.33 + '@types/node': 18.19.44 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -19934,7 +19834,7 @@ snapshots: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) get-uri: 6.0.3 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 @@ -20240,7 +20140,7 @@ snapshots: proxy-agent@6.4.0: dependencies: agent-base: 7.1.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 lru-cache: 7.18.3 @@ -20269,7 +20169,7 @@ snapshots: dependencies: '@puppeteer/browsers': 2.2.3 chromium-bidi: 0.5.19(devtools-protocol@0.0.1286932) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) devtools-protocol: 0.0.1286932 ws: 8.17.0(bufferutil@4.0.7)(utf-8-validate@6.0.3) transitivePeerDependencies: @@ -20517,11 +20417,6 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-transition-state@2.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-universal-interface@0.6.2(react@18.3.1)(tslib@2.6.2): dependencies: react: 18.3.1 @@ -21105,7 +21000,7 @@ snapshots: socket.io-client@4.7.5(bufferutil@4.0.7)(utf-8-validate@6.0.3): dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) engine.io-client: 6.5.3(bufferutil@4.0.7)(utf-8-validate@6.0.3) socket.io-parser: 4.2.4 transitivePeerDependencies: @@ -21116,14 +21011,14 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) transitivePeerDependencies: - supports-color socks-proxy-agent@8.0.3: dependencies: agent-base: 7.1.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -21422,24 +21317,6 @@ snapshots: transitivePeerDependencies: - '@babel/core' - styled-components@5.3.11(@babel/core@7.24.6)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1): - dependencies: - '@babel/helper-module-imports': 7.24.6 - '@babel/traverse': 7.24.6(supports-color@5.5.0) - '@emotion/is-prop-valid': 1.2.2 - '@emotion/stylis': 0.8.5 - '@emotion/unitless': 0.7.5 - babel-plugin-styled-components: 2.1.4(@babel/core@7.24.6)(styled-components@5.3.11(@babel/core@7.24.6)(react-dom@18.3.1(react@18.3.1))(react-is@18.3.1)(react@18.3.1)) - css-to-react-native: 3.2.0 - hoist-non-react-statics: 3.3.2 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-is: 18.3.1 - shallowequal: 1.1.0 - supports-color: 5.5.0 - transitivePeerDependencies: - - '@babel/core' - styled-jsx@5.1.1(@babel/core@7.24.6)(react@18.3.1): dependencies: client-only: 0.0.1 @@ -21482,7 +21359,7 @@ snapshots: stylelint-processor-styled-components@1.10.0: dependencies: '@babel/parser': 7.24.6 - '@babel/traverse': 7.24.6 + '@babel/traverse': 7.24.6(supports-color@5.5.0) micromatch: 4.0.7 postcss: 7.0.39 transitivePeerDependencies: @@ -21513,7 +21390,7 @@ snapshots: colord: 2.9.3 cosmiconfig: 7.1.0 css-functions-list: 3.2.2 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) fast-glob: 3.3.2 fastest-levenshtein: 1.0.16 file-entry-cache: 6.0.1 @@ -22119,7 +21996,7 @@ snapshots: core-util-is: 1.0.2 extsprintf: 1.3.0 - viem@2.19.0(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8): + viem@2.19.4(bufferutil@4.0.7)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8): dependencies: '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.4.0 @@ -22127,9 +22004,9 @@ snapshots: '@scure/bip32': 1.4.0 '@scure/bip39': 1.3.0 abitype: 1.0.5(typescript@5.4.5)(zod@3.23.8) - isows: 1.0.4(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.3)) + isows: 1.0.4(ws@8.17.1(bufferutil@4.0.7)(utf-8-validate@6.0.3)) webauthn-p256: 0.0.5 - ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.3) + ws: 8.17.1(bufferutil@4.0.7)(utf-8-validate@6.0.3) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -22137,7 +22014,7 @@ snapshots: - utf-8-validate - zod - viem@2.19.4(bufferutil@4.0.7)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8): + viem@2.19.4(bufferutil@4.0.8)(typescript@5.4.5)(utf-8-validate@6.0.3)(zod@3.23.8): dependencies: '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.4.0 @@ -22145,9 +22022,9 @@ snapshots: '@scure/bip32': 1.4.0 '@scure/bip39': 1.3.0 abitype: 1.0.5(typescript@5.4.5)(zod@3.23.8) - isows: 1.0.4(ws@8.17.1(bufferutil@4.0.7)(utf-8-validate@6.0.3)) + isows: 1.0.4(ws@8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.3)) webauthn-p256: 0.0.5 - ws: 8.17.1(bufferutil@4.0.7)(utf-8-validate@6.0.3) + ws: 8.17.1(bufferutil@4.0.8)(utf-8-validate@6.0.3) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: @@ -22158,7 +22035,7 @@ snapshots: vite-node@1.6.0(@types/node@18.19.33)(terser@5.31.5): dependencies: cac: 6.7.14 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) pathe: 1.1.2 picocolors: 1.0.1 vite: 5.2.11(@types/node@18.19.33)(terser@5.31.5) @@ -22203,7 +22080,7 @@ snapshots: '@vitest/utils': 1.6.0 acorn-walk: 8.3.2 chai: 4.4.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.4(supports-color@5.5.0) execa: 8.0.1 local-pkg: 0.5.0 magic-string: 0.30.10 diff --git a/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx b/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx index a4ed26f78..6dae0617f 100644 --- a/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx +++ b/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx @@ -76,6 +76,7 @@ export const TaggedNameItem = ({ selected={selected} disabled={disabled} onClick={onClick} + data-testid="name-detail-item" > {hasOtherItems && diff --git a/src/components/@molecules/NameTableHeader/NameTableHeader.tsx b/src/components/@molecules/NameTableHeader/NameTableHeader.tsx index 1c4479a40..3852ff9f9 100644 --- a/src/components/@molecules/NameTableHeader/NameTableHeader.tsx +++ b/src/components/@molecules/NameTableHeader/NameTableHeader.tsx @@ -190,12 +190,14 @@ export const NameTableHeader = ({ onSortDirectionChange?.('asc')} + data-testid="direction-button-asc" > onSortDirectionChange?.('desc')} + data-testid="direction-button-desc" >