diff --git a/cypress/integration/nameDetail.spec.js b/cypress/integration/nameDetail.spec.js index 0abe5abdb..d4b29c693 100644 --- a/cypress/integration/nameDetail.spec.js +++ b/cypress/integration/nameDetail.spec.js @@ -350,29 +350,6 @@ describe('Name detail view', () => { }) }) - // it('can set old content', () => { - // const content = - // '0xd1de9994b4d039f6548d191eb26786769f580809256b4685ef316805265ea162' - - // cy.visit(`${NAME_ROOT}/oldresolver.eth`) - - // cy.getByTestId('name-details').within(container => { - // cy.getByTestId('edit-content', { exact: false }).click({ force: true }) - // cy.getByPlaceholderText('Enter a content', { - // exact: false - // }).type(content, { force: true }) - // waitUntilInputResolves('Save').then(() => { - // cy.getByText('Save').click({ force: true }) - - // //form closed - // waitUntilTestIdDoesNotExist('action') - // waitUntilTestIdDoesNotExist('cancel') - // //Value updated - // cy.queryByText(content, { exact: false }).should('exist') - // }) - // }) - // }) - it('can delete records', () => { cy.visit(`${NAME_ROOT}/notsoawesome.eth`) cy.getByTestId('name-details').within(container => { diff --git a/cypress/integration/resolverMigration.spec.js b/cypress/integration/resolverMigration.spec.js index 5769d6f3a..882a78646 100644 --- a/cypress/integration/resolverMigration.spec.js +++ b/cypress/integration/resolverMigration.spec.js @@ -6,6 +6,7 @@ const DISABLED_COLOUR = 'rgb(223, 223, 223)' describe('Migrate resolver and records', () => { it('can visit a name with an old resolver and migrate it', () => { cy.visit(`${ROOT}/name/abittooawesome2.eth`) + cy.wait(3000) cy.getByText('Migrate').click({ force: true }) cy.queryByText('migrate', { timeout: 50 }).should('not.exist') cy.wait(1000) @@ -16,6 +17,22 @@ describe('Migrate resolver and records', () => { ) }) + it('can visit a name with an old content resolver and migrate it as swarm contenthash', () => { + cy.visit(`${ROOT}/name/oldresolver.eth`) + cy.wait(3000) // this one took a while to render Migrate + cy.getByText('Migrate').click({ force: true }) + cy.queryByText('migrate', { timeout: 50 }).should('not.exist') + cy.wait(1000) + cy.queryByTestId('edit-resolver').should( + 'have.css', + 'background-color', + ENABLED_COLOUR + ) + cy.queryByText('bzz://', { + exact: false + }).should('exist') + }) + it('cannot migrate resolver if the parent domain is not migrateed', () => { cy.visit(`${ROOT}/name/a1.sub2.testing.eth`) cy.wait(1000) diff --git a/package.json b/package.json index d9c7d4004..c49032516 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ } }, "devDependencies": { - "@ensdomains/mock": "2.0.6", + "@ensdomains/mock": "2.0.7", "apollo-client-mock": "0.0.8", "babel-plugin-macros": "^2.4.2", "cypress": "^3.5.0", diff --git a/src/api/manager/resolvers.js b/src/api/manager/resolvers.js index 82a961d7a..0c3baedd3 100644 --- a/src/api/manager/resolvers.js +++ b/src/api/manager/resolvers.js @@ -38,8 +38,7 @@ import { encodeContenthash, getResolverContract, getOldResolverContract, - getNamehash, - getProvider + getNamehash } from '@ensdomains/ui' import { formatsByName } from '@ensdomains/address-encoder' import isEqual from 'lodash/isEqual' @@ -544,8 +543,8 @@ const resolvers = { '0xbf80bc10d6ebfee11bea9a157d762110a0b73d95' ] const localResolvers = - process.env.REACT_APP_DEPRECATED_RESOLVERS && - process.env.REACT_APP_DEPRECATED_RESOLVERS.split(',') + process.env.REACT_APP_OLD_CONTENT_RESOLVERS && + process.env.REACT_APP_OLD_CONTENT_RESOLVERS.split(',') const oldResolvers = [...oldContentResolvers, ...localResolvers].map( a => { diff --git a/src/testing-utils/preTest.js b/src/testing-utils/preTest.js index 176515568..dc434ef83 100644 --- a/src/testing-utils/preTest.js +++ b/src/testing-utils/preTest.js @@ -43,7 +43,11 @@ async function init() { const addresses = await deployTestEns({ web3, accounts, dnssec, migrate }) console.log(addresses) - const { ensAddress, oldResolverAddresses } = addresses + const { + ensAddress, + oldResolverAddresses, + oldContentResolverAddresses + } = addresses const envLocalFile = './.env.local' fs.writeFileSync('./cypress.env.json', JSON.stringify(addresses)) fs.writeFileSync(envLocalFile, `REACT_APP_ENS_ADDRESS=${ensAddress}`) @@ -53,11 +57,21 @@ async function init() { envLocalFile, `REACT_APP_DEPRECATED_RESOLVERS=${oldResolverAddresses.join(',')}` ) + fs.appendFileSync(envLocalFile, '\n') + fs.appendFileSync( + envLocalFile, + `REACT_APP_OLD_CONTENT_RESOLVERS=${oldContentResolverAddresses.join(',')}` + ) console.log( `Successfully wrote Old resolver address ${oldResolverAddresses.join( ',' )} to .env.local` ) + console.log( + `Successfully wrote Old content resolver address ${oldContentResolverAddresses.join( + ',' + )} to .env.local` + ) } init() diff --git a/yarn.lock b/yarn.lock index d118fb4d2..52b88921e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1337,10 +1337,10 @@ truffle "^5.0.5" web3-utils "^1.0.0-beta.48" -"@ensdomains/mock@2.0.6": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@ensdomains/mock/-/mock-2.0.6.tgz#af8bc795c6d313efe4d8145b29d9c185f833b4e9" - integrity sha512-a74vfJHCWsTmal2dOAEiS7Mb1gZvob/7EmdpZjWXk+8XwFVIHsz2rXf8d//p/FN1T/Tct8XdJQrd1vXl9GEyTw== +"@ensdomains/mock@2.0.7": + version "2.0.7" + resolved "https://registry.yarnpkg.com/@ensdomains/mock/-/mock-2.0.7.tgz#657b14635473bbb2c312d8edf781a327b7190aa8" + integrity sha512-f8GiV/iQTBgax/6kHsErhbTzs/TD9uFEDmVDHrqEjB1yP0zlaMzhH+SIlO2mz7zHoEMzoey+R+qYBXE+IEDYNg== dependencies: "@0xproject/utils" "^2.0.2" "@babel/runtime" "^7.4.4"