<commit_before>define([
  'common/views/dashboard',
  'extensions/models/model'
],
function (DashboardView, Model) {
  describe('DashboardView', function () {

    var view, model;
    beforeEach(function () {
      model = new Model({
        foo: 'bar',
        'dashboard-type': 'service',
        service: {
          'title': 'Carer\'s Allowance'
        }
      });
      view = new DashboardView({
        model: model,
        contentTemplate: jasmine.createSpy().andReturn('rendered')
      });
      view.moduleInstances = [
        { html: '<div>module 1</div>'},
        { html: '<div>module 2</div>'}
      ];
    });

    describe('getContent', function () {

      it('render content template with model data and module content', function () {
        var result = view.getContent();
        expect(result).toEqual('rendered');
        var context = view.contentTemplate.argsForCall[0][0];
        expect(context.foo).toEqual('bar');
        expect(context.modules).toEqual('<div>module 1</div><div>module 2</div>');
      });
    });

    describe('getPageHeader', function () {

      it('calculates correct page header for transactions', function () {
        model.set({
          title: 'Carer\'s Allowance'
        });
        view.dashboardType = 'transaction';
        expect(view.getPageHeader()).toEqual('Carer\'s Allowance');
      });

    });


    describe('getTagline', function () {

      it('calculates correct tagline for departments', function () {
        model.set({
          'dashboard-type': 'department',<commit_msg>Add test for getContent hasFooter conditional<commit_after>define([
  'common/views/dashboard',
  'extensions/models/model'
],
function (DashboardView, Model) {
  describe('DashboardView', function () {

    var view, model;
    beforeEach(function () {
      model = new Model({
        foo: 'bar',
        'dashboard-type': 'service',
        service: {
          'title': 'Carer\'s Allowance'
        }
      });
      view = new DashboardView({
        model: model,
        contentTemplate: jasmine.createSpy().andReturn('rendered')
      });
      view.moduleInstances = [
        { html: '<div>module 1</div>'},
        { html: '<div>module 2</div>'}
      ];
    });

    describe('getContent', function () {

      it('renders a content template with model data and module content', function () {
        var result = view.getContent();
        expect(result).toEqual('rendered');
        var context = view.contentTemplate.argsForCall[0][0];
        expect(context.foo).toEqual('bar');
        expect(context.modules).toEqual('<div>module 1</div><div>module 2</div>');
      });

      it('displays a footer on detailed dashboards', function () {
        model.set('dashboard-type', 'transaction');
        var transactionView = new DashboardView({
          model: model,
          contentTemplate: jasmine.createSpy()
        });
        transactionView.getContent();
        var context = transactionView.contentTemplate.argsForCall[0][0];
        expect(context.hasFooter).toEqual(true);
      });

      it('displays a footer on high volume dashboards', function () {
        model.set('dashboard-type', 'high-volume-transaction');
        var highVolumeView = new DashboardView({
          model: model,
          contentTemplate: jasmine.createSpy()
        });
        highVolumeView.getContent();
        var context = highVolumeView.contentTemplate.argsForCall[0][0];
        expect(context.hasFooter).toEqual(true);
      });

      it('does not display a footer by default', function () {
        view.getContent();
        var context = view.contentTemplate.argsForCall[0][0];
        expect(context.hasFooter).toEqual(false);
      });

    });

    describe('getPageHeader', function () {

      it('calculates correct page header for transactions', function () {
        model.set({
          title: 'Carer\'s Allowance'
        });
        view.dashboardType = 'transaction';
        expect(view.getPageHeader()).toEqual('Carer\'s Allowance');
      });

    });


    describe('getTagline', function () {

      it('calculates correct tagline for departments', function () {
        model.set({
          'dashboard-type': 'department',
{'fraction_non_alphanumeric': 0.14901682065861172, 'fraction_numerical': 0.0042643923240938165, 'mean_word_length': 2.559865092748735, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '5096695', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1164, 'n_words': 239}