Blame view

tests/login.js 940 Bytes
f0c912bf1   tmcdeveloper   add method tests ...
1
2
3
4
5
6
7
8
9
  /* eslint-env mocha */
  /* eslint-disable func-names, prefer-arrow-callback */
  
  describe('Log In', function () {
    beforeEach(function () {
      server.execute(function () {
        const user = Meteor.users.findOne({ 'emails.address': 'carl.winslow@abc.com' });
        if (user) {
          Meteor.users.remove(user._id);
f7c1860b5   tmcdeveloper   add basic accepta...
10
11
12
        }
      });
    });
f0c912bf1   tmcdeveloper   add method tests ...
13
14
    it('should allow us to login', function () {
      server.execute(function () {
f7c1860b5   tmcdeveloper   add basic accepta...
15
16
17
18
        Accounts.createUser({
          email: 'carl.winslow@abc.com',
          password: 'bigguy1989',
          profile: {
f0c912bf1   tmcdeveloper   add method tests ...
19
20
            name: { first: 'Carl', last: 'Winslow' },
          },
f7c1860b5   tmcdeveloper   add basic accepta...
21
22
        });
      });
f0c912bf1   tmcdeveloper   add method tests ...
23
24
25
26
      browser.url('http://localhost:3000/login')
             .setValue('[name="emailAddress"]', 'carl.winslow@abc.com')
             .setValue('[name="password"]', 'bigguy1989')
             .submitForm('form');
f7c1860b5   tmcdeveloper   add basic accepta...
27

f0c912bf1   tmcdeveloper   add method tests ...
28
29
      browser.waitForExist('.jumbotron');
      expect(browser.getUrl()).to.equal('http://localhost:3000/');
f7c1860b5   tmcdeveloper   add basic accepta...
30
31
    });
  });