<commit_before>var moment = require('moment');
var Backbone = require('backbone');
var DashboardInfoView = require('app/dashboard-info-view');

describe('app/dashboard-info-view', function () {
  beforeEach(function () {
    var yesterday = moment().subtract(1, 'days').format(); // 2015-11-26T13:19:32+01:00
    var model = new Backbone.Model({
      title: 'Mapaza',
      description: 'Lorem ipsum...',
      updatedAt: yesterday
    });
    this.view = new DashboardInfoView({
      model: model
    });

    this.view.render();
  });

  it('should render properly', function () {
    expect(this.view.$el.find('.CDB-Dashboard-infoTitle').text()).toEqual('Mapaza');
    expect(this.view.$el.find('.CDB-Dashboard-infoDescription').text()).toEqual('Lorem ipsum...');
    expect(this.view.$el.find('.CDB-Dashboard-infoUpdate').text()).toEqual('UPDATED a day ago');
  });

  it('should collapse the view', function () {
    expect(this.view.$el.hasClass('is-active')).toBeFalsy();

    this.view.$el.find('.js-toggle-view-link').click();

    expect(this.view.$el.hasClass('is-active')).toBeTruthy();

    this.view.$el.find('.js-toggle-view-link').click();

    expect(this.view.$el.hasClass('is-active')).toBeFalsy();
  });
});
<commit_msg>Fix dashboard info view specs<commit_after>var moment = require('moment');
var Backbone = require('backbone');
var DashboardInfoView = require('app/dashboard-info-view');

describe('app/dashboard-info-view', function () {
  beforeEach(function () {
    var yesterday = moment().subtract(1, 'days').format(); // 2015-11-26T13:19:32+01:00
    var model = new Backbone.Model({
      title: 'Mapaza',
      description: 'Lorem ipsum...',
      updatedAt: yesterday
    });
    this.view = new DashboardInfoView({
      model: model
    });

    this.view.render();
  });

  it('should render properly', function () {
    expect(this.view.$el.find('.CDB-Dashboard-infoTitle').text()).toEqual('Mapaza');
    expect(this.view.$el.find('.CDB-Dashboard-infoDescription').text()).toEqual('Lorem ipsum...');
    expect(this.view.$el.find('.CDB-Dashboard-infoUpdate').text()).toEqual('UPDATED a day ago');
  });

  it('should collapse the view', function () {
    expect(this.view.$el.hasClass('is-active')).toBeFalsy();

    this.view.$el.find('.js-toggle-view-link').first().click();

    expect(this.view.$el.hasClass('is-active')).toBeTruthy();

    this.view.$el.find('.js-toggle-view-link').first().click();

    expect(this.view.$el.hasClass('is-active')).toBeFalsy();
  });
});

{'fraction_non_alphanumeric': 0.21144674085850557, 'fraction_numerical': 0.015103338632750398, 'mean_word_length': 3.9064327485380117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '906460', 'n_tokens_mistral': 843, 'n_tokens_neox': 824, 'n_words': 114}