Socialify

Folder ..

Viewing index.spec.js
86 lines (72 loc) • 2.5 KB

 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const { beforeHelper, afterHelper } = require('./../../helper')

describe('Passwords audit', function() {
  this.timeout(10000)

  describe('User opens vault settings', () => {
    before(() => beforeHelper({ storage: 'collection' }))

    after(() => afterHelper())

    it('shows vault settings', () => {
      return expect(
        app.client
          .setValue('input[type=password]', 'password')
          .keys('\uE007')
          .waitForExist('.body .list')
          .click('.audit-button')
          .getText('.aside .audit h3')
      ).to.eventually.equal('Password Audit')
    })

    it('contains weak passwords section', () => {
      return expect(
        app.client.getText('.audit-group.level-one .title')
      ).to.eventually.equal('Weak')
    })

    it('contains list of weak passwords', () => {
      return expect(
        app.client.getText('.audit-group.level-one')
      ).to.eventually.equal(
        'Weak\nInstagram\nanotheruser\nFacebook\nmyuser\nGoogle\nsomeuser'
      )
    })

    it('contains duplicate passwords section', () => {
      return expect(
        app.client.getText('.audit-group.level-three .title')
      ).to.eventually.equal('Duplicates')
    })

    it('contains list of duplicate passwords', () => {
      return expect(
        app.client.getText('.audit-group.level-three')
      ).to.eventually.equal(
        'Duplicates\nInstagram\nanotheruser\nFacebook\nmyuser\nGoogle\nsomeuser'
      )
    })

    it('does not contain short passwords section', () => {
      return expect(
        app.client.isExisting('.audit-group.level-two')
      ).to.eventually.equal(false)
    })

    it('displays passwords overal score', () => {
      return expect(app.client.getText('.aside .score')).to.eventually.equal(
        '0\nOveral Score'
      )
    })

    it('displays weak passwords count', () => {
      return expect(
        app.client.getText('.aside .stats li:nth-child(1)')
      ).to.eventually.equal('Weak\n3')
    })

    it('displays short passwords count', () => {
      return expect(
        app.client.getText('.aside .stats li:nth-child(2)')
      ).to.eventually.equal('Too Short\n0')
    })

    it('displays duplicate passwords count', () => {
      return expect(
        app.client.getText('.aside .stats li:nth-child(3)')
      ).to.eventually.equal('Duplicates\n3')
    })

    it('displays old passwords count', () => {
      return expect(
        app.client.getText('.aside .stats li:nth-child(4)')
      ).to.eventually.equal('More than 6 month old\n3')
    })
  })
})