<commit_before>
'use strict';

var Chance = require('chance'),
    sessionPage = require('./pages/session'),
    MenuPage = require('./pages/menu'),
    SwellRTPage = require('./pages/swellrt'),
    chance = new Chance(),
    loginPage = new sessionPage.Login(),
    logoutPage = new sessionPage.Logout(),
    registerPage = new sessionPage.Register(),
    forgottenPasswordPage = new sessionPage.ForgottenPassword(),
    recoverPasswordPage = new sessionPage.RecoverPassword(),
    menu = new MenuPage(),
    swellrt = new SwellRTPage();

describe('Teem', function() {

  describe('login form', function() {
    it('should login existing user', function() {
      loginPage.get();

      loginPage.login();

      loginPage.expectNoErrors();

      expect(menu.currentNick()).toBe(loginPage.default.nick);
    });
  });

  describe('register form', function() {
    it('should register new user', function() {
      var nick = chance.word();

      registerPage.get();

      registerPage.register({ nick: nick });

      registerPage.expectNoErrors();

      expect(menu.currentNick()).toBe(nick);
    });
  });

  describe('forgotten and recover password form', function() {
    it('should allow a new user to recover her password', function() {
      var nick = chance.word(),
          email = chance.email(),
          newPassword = chance.word({ length: 10 });

      registerPage.get();

      registerPage.register({
        nick: nick,
        email: email
      });<commit_msg>Increase nick size to avoid colissions<commit_after>
'use strict';

var Chance = require('chance'),
    sessionPage = require('./pages/session'),
    MenuPage = require('./pages/menu'),
    SwellRTPage = require('./pages/swellrt'),
    chance = new Chance(),
    loginPage = new sessionPage.Login(),
    logoutPage = new sessionPage.Logout(),
    registerPage = new sessionPage.Register(),
    forgottenPasswordPage = new sessionPage.ForgottenPassword(),
    recoverPasswordPage = new sessionPage.RecoverPassword(),
    menu = new MenuPage(),
    swellrt = new SwellRTPage();

describe('Teem', function() {

  describe('login form', function() {
    it('should login existing user', function() {
      loginPage.get();

      loginPage.login();

      loginPage.expectNoErrors();

      expect(menu.currentNick()).toBe(loginPage.default.nick);
    });
  });

  describe('register form', function() {
    it('should register new user', function() {
      var nick = chance.word({ length: 10 });

      registerPage.get();

      registerPage.register({ nick: nick });

      registerPage.expectNoErrors();

      expect(menu.currentNick()).toBe(nick);
    });
  });

  describe('forgotten and recover password form', function() {
    it('should allow a new user to recover her password', function() {
      var nick = chance.word({ length: 10 }),
          email = chance.email(),
          newPassword = <PASSWORD>({ length: 10 });

      registerPage.get();

      registerPage.register({
        nick: nick,
        email: email
      });
{'fraction_non_alphanumeric': 0.1476221928665786, 'fraction_numerical': 0.002642007926023778, 'mean_word_length': 3.132332878581173, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7016308', 'n_tokens_mistral': 856, 'n_tokens_neox': 817, 'n_words': 205}