<commit_before>/* eslint-disable no-console */
import request from 'supertest';
import parsePassportSessionCookie from '../../util/cookies';

const agent = request.agent(process.env.APP_BASE_URL);

describe('/signin', () => {
  it('signs on correctly', async () => {
    const result = await agent.post('/signin').send('username=officer&password=password').expect(302);
    expect(result.headers.location).to.eql('/');
    expect(result.headers['set-cookie'][0]).to.include('express:sess=');
    const userDetails = { forename: 'John', surname: 'Smith', username: 'officer', email: '<EMAIL>' };
    const userDetailsString = JSON.stringify({ passport: { user: userDetails } });<commit_msg>CSRA-762: Fix failing e2e rest test<commit_after>/* eslint-disable no-console */
import request from 'supertest';
import parsePassportSessionCookie from '../../util/cookies';

const agent = request.agent(process.env.APP_BASE_URL);

describe('/signin', () => {
  it('signs in correctly', async () => {
    const result = await agent.post('/signin').send('username=officer&password=password').expect(302);
    expect(result.headers.location).to.eql('/');
    expect(result.headers['set-cookie'][0]).to.include('express:sess=');
    const userDetails = { forename: 'John', surname: 'Smith', username: 'officer', email: '<EMAIL>', authorities: [{ authority: 'ROLE_666' }] };
    const userDetailsString = JSON.stringify({ passport: { user: userDetails } });
{'fraction_non_alphanumeric': 0.18793342579750347, 'fraction_numerical': 0.010402219140083218, 'mean_word_length': 5.273913043478261, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2538472', 'n_tokens_mistral': 441, 'n_tokens_neox': 429, 'n_words': 90}