Skip to content

Commit

Permalink
Merge branch 'main' into fix/failure-from-found-tx
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB authored Nov 14, 2023
2 parents f786013 + fb93a2f commit a7cc95e
Show file tree
Hide file tree
Showing 131 changed files with 11,542 additions and 1,026 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ node_modules
# testing
/coverage
/playwright-report
/test-results

# next.js
/.next/
Expand Down Expand Up @@ -67,4 +68,4 @@ tsconfig.tsbuildinfo
# Sentry
.sentryclirc

.dev.vars
.dev.vars
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
Expand All @@ -14,7 +13,7 @@
"stylelint.configFile": ".stylelintrc.json",
"stylelint.validate": ["css", "typescriptreact"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"prettier.prettierPath": "node_modules/prettier/index.js",
"[svg]": {
"editor.defaultFormatter": "jock.svg"
},
Expand Down
1 change: 1 addition & 0 deletions deploy/00_register_legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
subnames,
...rest
}: Name) => {
// eslint-disable-next-line no-restricted-syntax
const secret = '0x0000000000000000000000000000000000000000000000000000000000000000'
const registrant = allNamedAccts[namedOwner]
const owner = namedController ? allNamedAccts[namedController] : undefined
Expand Down
18 changes: 9 additions & 9 deletions e2e/specs/stateful/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ const profiles = [
{
type: 'manager',
value: 'wrapmebaby.eth',
address: '0xFc5958B4B6F9a06D21E06429c8833f865577acf0',
},
{
type: 'owner',
value: 'wrapmebaby.eth',
address: '0xFc5958B4B6F9a06D21E06429c8833f865577acf0',
},
],
expiry: 'May 30, 2037',
Expand Down Expand Up @@ -208,26 +210,24 @@ test.describe('Profile', () => {
}

// should show details in more tab
await page.getByTestId('more-tab').click()

// should have correct ownership data
await page.getByTestId('ownership-tab').click()
for (const owner of profile.owners) {
await expect(page.getByTestId(`owner-button-name-name.${owner.type}`)).toContainText(
owner.value,
{ timeout: 25000 },
)
await expect(
page.getByTestId(`role-row-${owner.address}`).getByTestId(`role-tag-${owner.type}`),
).toBeVisible()
await expect(page.getByTestId(`role-row-${owner.address}`)).toContainText(owner.value)
}

// should have view link for registration transaction
await page.getByTestId('more-tab').click()
await page.getByTestId('ownership-tab').click()
await expect(page.getByTestId('etherscan-registration-link')).toHaveAttribute(
'href',
/https:\/\/goerli\.etherscan\.io\/tx\/0x[a-fA-F0-9]{64}/,
)

// should show the expiry of the name if available
if (profile.expiry) {
await expect(page.getByTestId('expiry-data')).toContainText(profile.expiry)
await expect(page.getByTestId('expiry-panel-expiry')).toContainText(profile.expiry)
}
})
}
Expand Down
109 changes: 109 additions & 0 deletions e2e/specs/stateless/advancedEditor.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import { expect } from '@playwright/test'
import { test } from '@root/playwright'

test('should be able to maintain state when returning from transaction modal to advanced editor', async ({
login,
makeName,
makePageObject,
}) => {
const name = await makeName({
label: 'profile',
type: 'legacy',
records: {
texts: [
{ key: 'name', value: 'Bob' },
{ key: 'text', value: 'text' },
{ key: 'com.twitter', value: '@test' },
],
coinTypes: [
{ key: 'SOL', value: 'HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH' },
{ key: 'ETH', value: '0xbec1C7C11F2Fa9AB24b9E49122D26e721766DAF6' },
{ key: 'BTC', value: '1PzAJcFtEiXo9UGtRU6iqXQKj8NXtcC7DE' },
],
contentHash: 'ipfs://bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y',
abi: {
contentType: 1,
data: '{"test":"test"}',
},
},
})

const recordsPage = makePageObject('RecordsPage')
const advancedEditor = makePageObject('AdvancedEditorModal')
const transactionModal = makePageObject('TransactionModal')

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

// Validate records
await expect(recordsPage.getRecordValue('text', 'name')).toHaveText('Bob')
await expect(recordsPage.getRecordValue('text', 'text')).toHaveText('text')
await expect(recordsPage.getRecordValue('text', 'com.twitter')).toHaveText('@test')
await expect(recordsPage.getRecordValue('address', 'sol')).toHaveText(
'HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH',
)
await expect(recordsPage.getRecordValue('address', 'eth')).toHaveText(
'0xbec1C7C11F2Fa9AB24b9E49122D26e721766DAF6',
)
await expect(recordsPage.getRecordValue('address', 'btc')).toHaveText(
'1PzAJcFtEiXo9UGtRU6iqXQKj8NXtcC7DE',
)
await expect(recordsPage.getRecordValue('contentHash')).toHaveText(
'ipfs://bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y',
)
await expect(recordsPage.getRecordValue('abi')).toHaveText('"{\\"test\\":\\"test\\"}"')

await recordsPage.editRecordsButton.click()

// Validate advanced editor
await expect(await advancedEditor.recordInput('text', 'text')).toHaveValue('text')
await expect(await advancedEditor.recordInput('text', 'name')).toHaveValue('Bob')
await expect(await advancedEditor.recordInput('text', 'com.twitter')).toHaveValue('@test')
await expect(await advancedEditor.recordInput('address', 'SOL')).toHaveValue(
'HN7cABqLq46Es1jh92dQQisAq662SmxELLLsHHe4YWrH',
)
await expect(await advancedEditor.recordInput('address', 'ETH')).toHaveValue(
'0xbec1C7C11F2Fa9AB24b9E49122D26e721766DAF6',
)
await expect(await advancedEditor.recordInput('address', 'BTC')).toHaveValue(
'1PzAJcFtEiXo9UGtRU6iqXQKj8NXtcC7DE',
)
await expect(await advancedEditor.recordInput('contentHash')).toHaveValue(
'ipfs://bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y',
)
await expect(await advancedEditor.recordInput('abi')).toHaveValue('"{\\"test\\":\\"test\\"}"')

await advancedEditor.recordClearButton('text', 'text').then((button) => button.click())
await advancedEditor.recordClearButton('address', 'SOL').then((button) => button.click())
await advancedEditor.recordClearButton('address', 'ETH').then((button) => button.click())
await advancedEditor.recordInput('contentHash').then((input) => input.fill(''))
await advancedEditor.recordInput('abi').then((input) => input.fill(''))

await advancedEditor.saveButton.click()

// Validate transaction display item
await expect(transactionModal.displayItem('update')).toHaveText('5 records')

await transactionModal.backButton.click()

// Validate inputs have been rebuilt correctly
await expect(await advancedEditor.recordComponent('text', 'text')).toHaveCount(0)
await expect(await advancedEditor.recordComponent('address', 'SOL')).toHaveCount(0)
await expect(await advancedEditor.recordComponent('address', 'ETH')).toHaveCount(0)
await expect(await advancedEditor.recordInput('contentHash')).toHaveValue('')
await expect(await advancedEditor.recordInput('abi')).toHaveValue('')

await advancedEditor.saveButton.click()

// Validate transaction display item
await expect(transactionModal.displayItem('update')).toHaveText('5 records')

await transactionModal.autoComplete()

// Validate change in records
await expect(recordsPage.getRecordButton('text', 'text')).toHaveCount(0)
await expect(recordsPage.getRecordButton('address', 'sol')).toHaveCount(0)
await expect(recordsPage.getRecordButton('address', 'eth')).toHaveCount(0)
await expect(recordsPage.getRecordButton('contentHash')).toHaveCount(0)
await expect(recordsPage.getRecordButton('abi')).toHaveCount(0)
})
Loading

0 comments on commit a7cc95e

Please sign in to comment.