aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/migrations/033-test.js
blob: b111198fd21c9002fbf5420971936051acb26555 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const assert = require('assert')
const migration33 = require('../../../app/scripts/migrations/033')

describe('Migration to delete notice controller', () => {
  const oldStorage = {
    'meta': {},
    'data': {
      'NoticeController': {
        'noticesList': [
          {
            id: 0,
            read: false,
            date: 'Thu Feb 09 2017',
            title: 'Terms of Use',
            body: 'notice body',
          },
          {
            id: 2,
            read: false,
            title: 'Privacy Notice',
            body: 'notice body',
          },
          {
            id: 4,
            read: false,
            title: 'Phishing Warning',
            body: 'notice body',
          },
        ],
      },
    },
  }

  it('removes notice controller from state', () => {
    migration33.migrate(oldStorage)
      .then(newStorage => {
        assert.equal(newStorage.data.NoticeController, undefined)
      })
  })
})