<commit_before>import React from 'react';
import { expect } from 'chai';
import { mountWithIntl } from './helpers/intl-test';

import DatetimeTaskResponse from '../../src/app/components/task/DatetimeTaskResponse';

describe('<DatetimeTaskResponse />', () => {
  const response = '2018-03-27 12:34 -3 BRT';
  const badResponse = 'NaN-NaN-NaN 0:0 0 GMT notime';

  it('Renders date', () => {
    const taskResponse = mountWithIntl(<DatetimeTaskResponse response={response} />);
    expect(taskResponse.html()).to.contain('March 27, 2018');
  });

  it('Renders date and time', () => {
    const taskResponse = mountWithIntl(<DatetimeTaskResponse response={response} />);
    expect(taskResponse.html()).to.contain('<span class="task__datetime-response"><span><span>March 27, 2018</span><!-- react-text: 4 --> at <!-- /react-text --><a href="https://time.is/2018-03-27 12:34 BRT" target="_blank" rel="noreferrer noopener" title="View this timezone on time.is">12:34 BRT</a></span></span>');
  });

  it('Displays error if bad data', () => {
    const taskResponse = mountWithIntl(<DatetimeTaskResponse response={badResponse} />);
    expect(taskResponse.html()).to.contain('Error: Invalid timestamp');
  });
});<commit_msg>#6787 Tag unit test with Mantis ticket #<commit_after>import React from 'react';
import { expect } from 'chai';
import { mountWithIntl } from './helpers/intl-test';

import DatetimeTaskResponse from '../../src/app/components/task/DatetimeTaskResponse';

describe('<DatetimeTaskResponse />', () => {
  const response = '2018-03-27 12:34 -3 BRT';
  const badResponse = 'NaN-NaN-NaN 0:0 0 GMT notime';

  it('Renders date', () => {
    const taskResponse = mountWithIntl(<DatetimeTaskResponse response={response} />);
    expect(taskResponse.html()).to.contain('March 27, 2018');
  });

  it('Renders date and time', () => {
    const taskResponse = mountWithIntl(<DatetimeTaskResponse response={response} />);
    expect(taskResponse.html()).to.contain('<span class="task__datetime-response"><span><span>March 27, 2018</span><!-- react-text: 4 --> at <!-- /react-text --><a href="https://time.is/2018-03-27 12:34 BRT" target="_blank" rel="noreferrer noopener" title="View this timezone on time.is">12:34 BRT</a></span></span>');
  });

  // Mantis #6787: Item shows as blank, possibly related to date/time task
  it('Displays error if bad data', () => {
    const taskResponse = mountWithIntl(<DatetimeTaskResponse response={badResponse} />);
    expect(taskResponse.html()).to.contain('Error: Invalid timestamp');
  });
});
{'fraction_non_alphanumeric': 0.18568056648308418, 'fraction_numerical': 0.03855232100708104, 'mean_word_length': 4.714606741573034, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 39, 'https://': 2, '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': '6069697', 'n_tokens_mistral': 872, 'n_tokens_neox': 779, 'n_words': 178}