Add migration tests to ensure that bodies are erased properly in notices.

feature/default_network_editable
Kevin Serrano 8 years ago
parent bcaf0864c1
commit d99b5a9e5a
No known key found for this signature in database
GPG Key ID: BF999DEFC7371BA1
  1. 7
      test/lib/migrations/004.json
  2. 7
      test/unit/migrations-test.js

@ -48,6 +48,13 @@
"title":"Ending Morden Support", "title":"Ending Morden Support",
"body":"Due to [recent events](https://blog.ethereum.org/2016/11/20/from-morden-to-ropsten/), MetaMask is now deprecating support for the Morden Test Network.\n\nUsers will still be able to access Morden through a locally hosted node, but we will no longer be providing hosted access to this network through [Infura](http://infura.io/).\n\nPlease use the new Ropsten Network as your new default test network.\n\nYou can fund your Ropsten account using the buy button on your account page.\n\nBest wishes!\nThe MetaMask Team\n\n", "body":"Due to [recent events](https://blog.ethereum.org/2016/11/20/from-morden-to-ropsten/), MetaMask is now deprecating support for the Morden Test Network.\n\nUsers will still be able to access Morden through a locally hosted node, but we will no longer be providing hosted access to this network through [Infura](http://infura.io/).\n\nPlease use the new Ropsten Network as your new default test network.\n\nYou can fund your Ropsten account using the buy button on your account page.\n\nBest wishes!\nThe MetaMask Team\n\n",
"id":0 "id":0
},
{
"read":false,
"date":"Sat Dec 17 2016",
"title":"Keeping It Real",
"body":"nonempty",
"id":1
} }
], ],
"conversionRate":12.66441492, "conversionRate":12.66441492,

@ -15,6 +15,8 @@ const migration8 = require(path.join('..', '..', 'app', 'scripts', 'migrations',
const migration9 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '009')) const migration9 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '009'))
const migration10 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '010')) const migration10 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '010'))
const migration11 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '011')) const migration11 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '011'))
const migration12 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '012'))
const oldTestRpc = 'https://rawtestrpc.metamask.io/' const oldTestRpc = 'https://rawtestrpc.metamask.io/'
const newTestRpc = 'https://testrpc.metamask.io/' const newTestRpc = 'https://testrpc.metamask.io/'
@ -91,6 +93,11 @@ describe('wallet1 is migrated successfully', () => {
}).then((eleventhResult) => { }).then((eleventhResult) => {
assert.equal(eleventhResult.data.isDisclaimerConfirmed, null, 'isDisclaimerConfirmed should not exist') assert.equal(eleventhResult.data.isDisclaimerConfirmed, null, 'isDisclaimerConfirmed should not exist')
assert.equal(eleventhResult.data.TOSHash, null, 'TOSHash should not exist') assert.equal(eleventhResult.data.TOSHash, null, 'TOSHash should not exist')
return migration12.migrate(eleventhResult)
}).then((twelfthResult) => {
assert.equal(twelfthResult.data.NoticeController.noticesList[0].body, '', 'notices that have been read should have an empty body.')
assert.equal(twelfthResult.data.NoticeController.noticesList[1].body, 'nonempty', 'notices that have not been read should not have an empty body.')
}) })
}) })

Loading…
Cancel
Save