<commit_before>describe('homepage', function () {
  it('should automatically redirect to /home', function () {
    browser.get('');
    expect(browser.getLocationAbsUrl()).toMatch('/home');
  });
  it('should contain header', function () {
    browser.get('#/home');
    expect(element(by.tagName('h1')).getText()).toBe('Home');
  });
});

describe('screen', function () {
  beforeEach(function () {
    browser.addMockModule('httpBackendMock', function () {
      angular.module('httpBackendMock', ['ngMockE2E'])
        .run(function ($httpBackend) {
          $httpBackend.whenGET('agents.json').respond([
            {
              id: 1,
              agent_id: 1234,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'TAUKO',
              time_in_status: 6485
            },
            {
              id: 2,
              agent_id: 4321,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'Sisäänkirjaus',
              time_in_status: 1278
            },
            {
              id: 10,
              agent_id: 8754,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'TAUKO',
              time_in_status: 543
            },
            {
              id: 6,
              agent_id: 666,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'TAUKO',
              time_in_status: 343
            }
          ]);
        });
    });
    browser.get('#/screen');
  });

  it('should something', function () {
    var agentCards = element.all(by.className('agent-card'));

    expect(agentCards.count()).toBe(4);

    expect(agentCards.get(0).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(0).element(by.className('agent-status')).getText()).toBe('TAUKO');

    expect(agentCards.get(1).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(1).element(by.className('agent-status')).getText()).toBe('Sisäänkirjaus');

    expect(agentCards.get(2).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(2).element(by.className('agent-status')).getText()).toBe('TAUKO');

    expect(agentCards.get(3).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(3).element(by.className('agent-status')).getText()).toBe('TAUKO');
  });

  it('Status color should match status text', function () {
    var agentCards = element.all(by.className('agent-card'));

    expect(agentCards.get(0).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-red');
    expect(agentCards.get(1).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-green');
    expect(agentCards.get(2).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-red');
    expect(agentCards.get(3).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-red');
  });

  it('Sidebar status view should be correct', function () {
    var statusCount = element.all(by.className('agent-status-count'));

    expect(statusCount.get(0).element(by.className('green-count')).getText()).toBe('1');
    expect(statusCount.get(1).element(by.className('yellow-count')).getText()).toBe('0');
    expect(statusCount.get(2).element(by.className('red-count')).getText()).toBe('3');
  });

  it('should filter correctly', function () {
    var agentCards;
    element(by.linkText('rajaa')).click();
    element(by.id('TAUKO')).click();
    element(by.linkText('Show state screen')).click();
    agentCards = element.all(by.className('agent-card'));
    expect(agentCards.count()).toBe(1);
    expect(agentCards.get(0).element(by.className('agent-name')).getText())
      .toBe('<NAME>');
    expect(agentCards.get(0).element(by.className('agent-status')).getText())
      .toBe('Sisäänkirjaus');
  });
});

describe('queue', function () {
  beforeEach(function () {
    browser.addMockModule('httpBackendMock', function () {<commit_msg>Fixed filter Protractor tests<commit_after>describe('homepage', function () {
  it('should automatically redirect to /home', function () {
    browser.get('');
    expect(browser.getLocationAbsUrl()).toMatch('/home');
  });
  it('should contain header', function () {
    browser.get('#/home');
    expect(element(by.tagName('h1')).getText()).toBe('Home');
  });
});

describe('screen', function () {
  beforeEach(function () {
    browser.addMockModule('httpBackendMock', function () {
      angular.module('httpBackendMock', ['ngMockE2E'])
        .run(function ($httpBackend) {
          $httpBackend.whenGET('agents.json').respond([
            {
              id: 1,
              agent_id: 1234,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'Tauko',
              time_in_status: 6485
            },
            {
              id: 2,
              agent_id: 4321,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'Vapaa',
              time_in_status: 1278
            },
            {
              id: 10,
              agent_id: 8754,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'Tauko',
              time_in_status: 543
            },
            {
              id: 6,
              agent_id: 666,
              name: '<NAME>',
              team: 'Helpdesk',
              status: 'Tauko',
              time_in_status: 343
            }
          ]);
          $httpBackend.whenGET('teams.json').respond([
            {
              name: 'Helpdesk',
              filter: true
            }
          ]);
          $httpBackend.whenGET('states.json').respond([
            {
              name: 'Tauko',
              filter: true
            }
          ]);
        });
    });
    browser.get('#/screen');
  });

  it('should something', function () {
    var agentCards = element.all(by.className('agent-card'));

    expect(agentCards.count()).toBe(4);

    expect(agentCards.get(0).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(0).element(by.className('agent-status')).getText()).toBe('Tauko');

    expect(agentCards.get(1).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(1).element(by.className('agent-status')).getText()).toBe('Vapaa');

    expect(agentCards.get(2).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(2).element(by.className('agent-status')).getText()).toBe('Tauko');

    expect(agentCards.get(3).element(by.className('agent-name')).getText()).toBe('<NAME>');
    expect(agentCards.get(3).element(by.className('agent-status')).getText()).toBe('Tauko');
  });

  it('Status color should match status text', function () {
    var agentCards = element.all(by.className('agent-card'));

    expect(agentCards.get(0).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-red');
    expect(agentCards.get(1).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-green');
    expect(agentCards.get(2).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-red');
    expect(agentCards.get(3).element(by.className('agent-status-color')).getAttribute('class'))
      .toMatch('agent-status-color-red');
  });

  it('Sidebar status view should be correct', function () {
    var statusCount = element.all(by.className('agent-status-count'));

    expect(statusCount.get(0).element(by.className('green-count')).getText()).toBe('1');
    expect(statusCount.get(1).element(by.className('yellow-count')).getText()).toBe('0');
    expect(statusCount.get(2).element(by.className('red-count')).getText()).toBe('3');
  });

  it('should filter correctly', function () {
    var agentCards;
    element(by.linkText('rajaa')).click();
    element(by.id('Tauko')).click();
    element(by.linkText('Show state screen')).click();
    agentCards = element.all(by.className('agent-card'));
    expect(agentCards.count()).toBe(1);
    expect(agentCards.get(0).element(by.className('agent-name')).getText())
      .toBe('<NAME>');
    expect(agentCards.get(0).element(by.className('agent-status')).getText())
      .toBe('Vapaa');
  });
});

describe('queue', function () {
  beforeEach(function () {
    browser.addMockModule('httpBackendMock', function () {
{'fraction_non_alphanumeric': 0.1938182663258192, 'fraction_numerical': 0.013478968161747618, 'mean_word_length': 2.801678445229682, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '4701572', 'n_tokens_mistral': 2623, 'n_tokens_neox': 2599, 'n_words': 301}