Skip to content

Commit

Permalink
Merge branch 'main' into coinbase-wallet-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sugh01 committed Sep 9, 2024
2 parents abe28d0 + 57a8eba commit 1ccd7df
Show file tree
Hide file tree
Showing 21 changed files with 821 additions and 379 deletions.
186 changes: 184 additions & 2 deletions e2e/specs/stateless/wrapName.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ test('should not show wrap notification if the name is already wrapped', async (

await page.waitForTimeout(3000)
await expect(morePage.wrapButton).not.toBeVisible()

await expect(morePage.pccStatus).toBeVisible()
await expect(morePage.nameWrapperStatus).toHaveText('Wrapped')
})

test('should show wrap button on unwrapped name', async ({ login, makeName, makePageObject }) => {
Expand Down Expand Up @@ -255,7 +258,7 @@ test('should calculate needed steps without localstorage', async ({
await login.connect()

await page.pause()
await expect(page.getByTestId('name-details-text-wrapper')).toContainText('unwrapped')
await expect(page.getByTestId('namewrapper-status')).toContainText('Unwrapped')

await morePage.wrapButton.click()
await page.pause()
Expand Down Expand Up @@ -291,8 +294,187 @@ test('should calculate needed steps without localstorage', async ({
await transactionModal.introButton.click()
await transactionModal.confirm()
await transactionModal.complete()
await expect(page.getByTestId('name-details-text-wrapper')).not.toContainText('unwrapped')
await expect(page.getByTestId('namewrapper-status')).not.toContainText('Unwrapped')

await profilePage.goto(subname)
await expect(profilePage.record('text', 'description')).toHaveText('test')
})

test('Wrapped, emancipated, 2LD', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'wrapped',
type: 'wrapped',
owner: 'user',
})

const morePage = makePageObject('MorePage')
await morePage.goto(name)

await login.connect()

await expect(morePage.wrapButton).not.toBeVisible()
await expect(morePage.unwrapButton).toBeVisible()
await expect(morePage.nameWrapperStatus).toContainText('Wrapped')
await expect(morePage.pccStatus).toContainText('Not parent-controllable')
await expect(morePage.nameWrapperCheckIcon).toBeVisible()
await expect(morePage.npcIcon).toBeVisible()
})

test('Wrapped, locked, 2LD', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'wrapped',
type: 'wrapped',
owner: 'user',
fuses: {
named: ['CANNOT_UNWRAP'],
},
})

const morePage = makePageObject('MorePage')
await morePage.goto(name)

await login.connect()

await expect(morePage.wrapButton).not.toBeVisible()
await expect(morePage.unwrapButtonDisabled).toBeVisible()
await expect(morePage.nameWrapperStatus).toContainText('Wrapped')
await expect(morePage.pccStatus).toContainText('Not parent-controllable')
await expect(morePage.nameWrapperLockIcon).toBeVisible()
await expect(morePage.npcIcon).toBeVisible()
})

test('Wrapped, not-emancipated (PCC), 3LD', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'wrapped',
type: 'wrapped',
owner: 'user',
subnames: [
{
label: 'test',
owner: 'user',
},
],
})

const morePage = makePageObject('MorePage')
await morePage.goto(`test.${name}`)

await login.connect()

await expect(morePage.unwrapButton).toBeVisible()
await expect(morePage.nameWrapperStatus).toContainText('Wrapped')
await expect(morePage.pccStatus).toContainText('Parent-controllable')
await expect(morePage.nameWrapperCheckIcon).toBeVisible()
await expect(morePage.nameWrapperLockIcon).not.toBeVisible()
await expect(morePage.pccIcon).toBeVisible()
await expect(morePage.nameWrapperLockIcon).not.toBeVisible()
})

test('Wrapped, emancipated(NPC), 3LD', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'wrapped',
type: 'wrapped',
owner: 'user',
fuses: {
named: ['CANNOT_UNWRAP'],
},
subnames: [
{
label: 'test',
owner: 'user',
fuses: {
parent: {
named: ['PARENT_CANNOT_CONTROL'],
},
},
},
],
})

const morePage = makePageObject('MorePage')
await morePage.goto(`test.${name}`)

await login.connect()

await expect(morePage.unwrapButton).toBeVisible()
await expect(morePage.nameWrapperStatus).toContainText('Wrapped')
await expect(morePage.pccStatus).toContainText('Not parent-controllable')
await expect(morePage.nameWrapperCheckIcon).toBeVisible()
await expect(morePage.npcIcon).toBeVisible()
await expect(morePage.nameWrapperLockIcon).not.toBeVisible()
})

test('Wrapped, emancipated(NPC), Locked, 3LD', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'wrapped',
type: 'wrapped',
owner: 'user',
fuses: {
named: ['CANNOT_UNWRAP'],
},
subnames: [
{
label: 'test',
owner: 'user',
fuses: {
parent: {
named: ['PARENT_CANNOT_CONTROL'],
},
child: {
named: ['CANNOT_UNWRAP'],
},
},
},
],
})

const morePage = makePageObject('MorePage')
await morePage.goto(`test.${name}`)

await login.connect()

await expect(morePage.nameWrapperStatus).toContainText('Wrapped')
await expect(morePage.pccStatus).toContainText('Not parent-controllable')
await expect(morePage.nameWrapperLockIcon).toBeVisible()
await expect(morePage.npcIcon).toBeVisible()
await expect(morePage.unwrapButtonDisabled).toBeVisible()
})

test('Wrapped, emancipated(NPC), 3LD Manager', async ({ login, makeName, makePageObject }) => {
const name = await makeName({
label: 'wrapped',
type: 'wrapped',
owner: 'user2',
fuses: {
named: ['CANNOT_UNWRAP'],
},
subnames: [
{
label: 'test',
owner: 'user',
fuses: {
parent: {
named: ['PARENT_CANNOT_CONTROL'],
},
},
},
],
})

const morePage = makePageObject('MorePage')
const transactionModal = makePageObject('TransactionModal')
await morePage.goto(`test.${name}`)

await login.connect()

await expect(morePage.unwrapButton).toBeVisible()
await expect(morePage.nameWrapperStatus).toContainText('Wrapped')
await expect(morePage.pccStatus).toContainText('Not parent-controllable')
await expect(morePage.nameWrapperCheckIcon).toBeVisible()
await expect(morePage.npcIcon).toBeVisible()
await expect(morePage.nameWrapperLockIcon).not.toBeVisible()

await morePage.unwrapButton.click()
await transactionModal.autoComplete()
await expect(morePage.wrapButton).toBeVisible()
})
21 changes: 21 additions & 0 deletions playwright/pageObjects/morePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ export class MorePage {

readonly unwrapButton: Locator

readonly pccStatus: Locator

readonly nameWrapperStatus: Locator

readonly unwrapButtonDisabled: Locator

readonly nameWrapperLockIcon: Locator

readonly nameWrapperCheckIcon: Locator

readonly npcIcon: Locator

readonly pccIcon: Locator

constructor(page: Page) {
this.page = page
this.getSendNameButton = this.page.getByTestId('send-name-button')
Expand All @@ -30,6 +44,13 @@ export class MorePage {
this.resolver = this.page.getByTestId('name-details-text')
this.wrapButton = this.page.getByTestId('wrap-name-btn')
this.unwrapButton = this.page.getByTestId('unwrap-name-btn')
this.pccStatus = this.page.getByTestId('pcc-status')
this.nameWrapperStatus = this.page.getByTestId('namewrapper-status')
this.unwrapButtonDisabled = this.page.getByTestId('cannot-unwrap-disabled-button')
this.nameWrapperLockIcon = this.page.getByTestId('namewrapper-lock-icon')
this.nameWrapperCheckIcon = this.page.getByTestId('namewrapper-check-icon')
this.npcIcon = this.page.getByTestId('npc-icon')
this.pccIcon = this.page.getByTestId('pcc-icon')
}

async goto(name: string) {
Expand Down
Loading

0 comments on commit 1ccd7df

Please sign in to comment.