Socialify

Folder ..

Viewing password.spec.js
65 lines (55 loc) • 2.0 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
const { beforeHelper, afterHelper } = require('./../../helper')

describe('Password generation settings', function() {
  this.timeout(10000)

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

    after(() => afterHelper())

    it('shows password settings', () => {
      return expect(
        app.client
          .setValue('input[type=password]', 'password')
          .keys('\uE007')
          .waitForExist('.body .list')
          .click('.settings-button')
          .click('.window .navigation li:nth-child(2)')
          .getText('.body h1')
      ).to.eventually.equal('Password Generation')
    })

    it('contains password preview', () => {
      return expect(
        app.client.isExisting('.section:nth-of-type(1) .password-sample')
      ).to.eventually.equal(true)
    })

    it('password preview of default length', () => {
      return expect(
        app.client
          .getText('.section:nth-of-type(1) .password-sample')
          .then(value => value.length)
      ).to.eventually.equal(12)
    })

    it('changes password preview length', () => {
      return expect(
        app.client
          .isExisting('.section:nth-of-type(2) input[type=range]')
          .setValue('.section:nth-of-type(2) input[type=range]', 28)
          .getText('.section:nth-of-type(1) .password-sample')
          .then(value => value.length)
      ).to.eventually.equal(28)
    })

    it('contains numbers checkbox', () => {
      return expect(
        app.client.isExisting('.section:nth-of-type(3) input[name=numbers]')
      ).to.eventually.equal(true)
    })

    it('contains uppercase checkbox', () => {
      return expect(
        app.client.isExisting('.section:nth-of-type(3) input[name=uppercase]')
      ).to.eventually.equal(true)
    })

    it('contains special symbols checkbox', () => {
      return expect(
        app.client.isExisting('.section:nth-of-type(3) input[name=symbols]')
      ).to.eventually.equal(true)
    })
  })
})