<commit_before><commit_msg>start projectquire testing<commit_after>/* eslint-env mocha */

let chai = require('chai');
let expect = chai.expect;
let dirtyChai = require('dirty-chai');
let proxyquire = require('proxyquire');

chai.use(dirtyChai);

describe('Projectquire module', () => {
  describe('helper functions', () => {
    let projectId = 1;
    let url = 'url';
    let data;
    let graph;

    let resolvedProjectPromise = () => {
      return new Promise(function (resolve, reject) {
        resolve(data);
      });
    };
    let rejectedProjectPromise = () => {
      return new Promise(function (resolve, reject) {
        reject('Error');
      });
    };

    it('should return a resolved promise when there exists a project name.', () => {
      data = [{'name': 'mocked project name'}];
      graph = proxyquire('../../lib/graph', {'./pagination': resolvedProjectPromise});
      expect(graph.getProjectName(projectId, url)).to.be.fulfilled();
    });

    it('should return a rejected promise when no project name exists.', function () {
      data = [{'name': 'mocked project name'}];
      graph = proxyquire('../../lib/graph', {'./pagination': rejectedProjectPromise});
      let app2 = rewire(graph);
      let getProjectName = app2.__get__('getProjectName');
      expect(getProjectName(projectId, url)).to.be.rejected();
    });

    it('should return a resolved promise when there exists at least one item.', () => {

    });

    it('should return a rejected promise when no items exist.', () => {

    });

    it('should return a resolved promise when there exists at least one item relationship.', () => {

    });

    it('should return a rejected promise when no item relationships exist.', () => {

    });
  });
});
{'fraction_non_alphanumeric': 0.16171428571428573, 'fraction_numerical': 0.0017142857142857142, 'mean_word_length': 3.1297169811320753, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '1648792', 'n_tokens_mistral': 489, 'n_tokens_neox': 477, 'n_words': 142}