<commit_before>var _ = require('underscore-cdb-v3');
var cdb = require('cartodb.js-v3');
var FlashMessageModel = require('../../../../javascripts/cartodb/organization/flash_message_model');
var AccountContentView = require('../../../../javascripts/cartodb/account/account_content_view');

describe('account/account_content_view', function () {
  beforeEach(function () {
    this.user = new cdb.admin.User({
      username: 'pepe',
      base_url: 'http://pepe.carto.com',
      email: '<EMAIL>',
      account_type: 'FREE'
    });

    this.flashMessageModel = new FlashMessageModel();

    this.view = new AccountContentView({
      user: this.user,
      flashMessageModel: this.flashMessageModel
    });
  });

  describe('.render', function () {
    it('should render properly', function () {
      spyOn(this.view, '_initViews');

      this.view.render();

      expect(this.view.$el.html()).toContain('<div class="SideMenu CDB-Text CDB-Size-medium js-SideMenu"></div>');
      expect(this.view.$el.html()).toContain('<div class="js-AccountContent"></div>');
      expect(this.view._initViews).toHaveBeenCalled();
    });
  });

  describe('._initModels', function () {
    it('should init models', function () {
      this.view.render();

      expect(this.view.user).toBe(this.user);
      expect(this.view.model).toBeDefined();
    });
  });

  describe('._initViews', function () {
    it('should init views', function () {
      this.view.render();

      expect(_.size(this.view._subviews)).toBe(2);
    });
  });

  describe('._setLoading', function () {
    it('should hide flash message and set loading', function () {
      spyOn(this.flashMessageModel, 'hide');

      expect(this.view.model.get('isLoading')).toBeUndefined();
      expect(this.view.model.get('loadingText')).toBeUndefined();
<commit_msg>fix tests<commit_after>var _ = require('underscore-cdb-v3');
var cdb = require('cartodb.js-v3');
var FlashMessageModel = require('../../../../javascripts/cartodb/organization/flash_message_model');
var AccountContentView = require('../../../../javascripts/cartodb/account/account_content_view');

describe('account/account_content_view', function () {
  beforeEach(function () {
    this.user = new cdb.admin.User({
      username: 'pepe',
      base_url: 'http://pepe.carto.com',
      email: '<EMAIL>',
      account_type: 'FREE'
    });

    this.flashMessageModel = new FlashMessageModel();

    this.view = new AccountContentView({
      user: this.user,
      flashMessageModel: this.flashMessageModel
    });
  });

  describe('.render', function () {
    it('should render properly', function () {
      spyOn(this.view, '_initViews');

      this.view.render();

      expect(this.view.$el.html()).toContain('<div class="SideMenu CDB-Text CDB-Size-medium js-SideMenu"></div>');
      expect(this.view.$el.html()).toContain('<div class="js-AccountContent"></div>');
      expect(this.view._initViews).toHaveBeenCalled();
    });
  });

  describe('._initModels', function () {
    it('should init models', function () {
      expect(this.view._userModel).toBe(this.user);
      expect(this.view.model).toBeDefined();
    });
  });

  describe('._initViews', function () {
    it('should init views', function () {
      this.view.render();

      expect(_.size(this.view._subviews)).toBe(2);
    });
  });

  describe('._setLoading', function () {
    it('should hide flash message and set loading', function () {
      spyOn(this.flashMessageModel, 'hide');

      expect(this.view.model.get('isLoading')).toBeUndefined();
      expect(this.view.model.get('loadingText')).toBeUndefined();

{'fraction_non_alphanumeric': 0.18751726042529687, 'fraction_numerical': 0.0016570008285004142, 'mean_word_length': 3.4937965260545907, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '5325305', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1094, 'n_words': 166}