{"size": 2225, "ext": "js", "max_stars_repo_path": "grantly/src/components/grants/GrantList.test.js", "max_stars_repo_name": "rorychristianmurray/Founder-Grants", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "grantly/src/components/grants/GrantList.test.js", "max_issues_repo_name": "rorychristianmurray/Founder-Grants", "max_issues_repo_issues_event_min_datetime": "2022-02-13T20:47:10.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T10:35:25.000Z", "max_forks_repo_path": "grantly/src/components/grants/GrantList.test.js", "max_forks_repo_name": "rorychristianmurray/Founder-Grants", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 29.2763157895, "max_line_length": 131, "alphanum_fraction": 0.644494382}
// import { sum } from "./index";
// const summer = require("./GrantList");

import React from "react";
import * as rtl from "@testing-library/react";
// import "@testing-library/jest-dom/extend-expect";
import { GrantList, addFieldGoal } from "./GrantList";
// import { addFieldGoal } from "./GrantList";
const summer = require("./index");

// unit testing

// describe("sum function", () => {
//   it("sums two integers", () => {
//     // Arrange - set up mock data
//     let expected = 3;
//     let a = 1;
//     let b = 2;

//     // Act - invokes the test with arranged params
//     let actual = summer.sum(a, b);

//     // Assert
//     expect(actual).toBe(expected);

//     // second assertion
//     expected = 5;
//     expect(summer.sum(2, 3)).toBe(expected);
//   });
// });

// integration testing
const mockData = {
  data: {
    amount: 15000,
    amount_notes:
      "$15,000 along with trip to compete in the live pitching finals at the Global Entrepreneurship Summit; grants and mentoring",
    area_focus: "Social Entrepreneurship",
    competition_name: "GIST Tech-I Competition",
    details_last_updated: "2017-08-23T00:00:00.000Z",
    domain_areas:
      "Environment, conservation, water, agriculture, energy, ICT, health",
    early_stage_funding: false,
    geographic_region: "Global",
    id: 1,
    most_recent_application_due_date: null,
    notes:
      "Idea can be an invention, product, service, app, or any combination, or something unique",
    sponsoring_entity: "Global Innovation Through Science and Technology",
    target_entrepreneur_demographic: null,
    type: "Competition",
    website: "http://www.gistnetwork.org/content/gist-tech-i"
  }
};

test("it renders without crashing", () => {
  const container = rtl.render(<GrantList data={mockData} />);
});

test("contains grants", () => {
  const container = rtl.render(<GrantList data={mockData} />);

  container.queryAllByText(/grants/i);
});

// test('props.data.length is truthy', () =? {
//   const container = rtl.render(<GrantList data={mockData} />);
//   container

// });

// test("addFieldGoal adds 3 to current score", () => {
//   expect(addFieldGoal(7)).toBe(10);
//   expect(addFieldGoal(0)).toBe(3);
// });
