{"size": 1511, "ext": "js", "max_stars_repo_path": "app/containers/GetString/tests/actions.test.js", "max_stars_repo_name": "YozoraNoHoshi/react-boilerplate", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/containers/GetString/tests/actions.test.js", "max_issues_repo_name": "YozoraNoHoshi/react-boilerplate", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/containers/GetString/tests/actions.test.js", "max_forks_repo_name": "YozoraNoHoshi/react-boilerplate", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.7435897436, "max_line_length": 124, "alphanum_fraction": 0.6386499007}
import { getStringAction, getStringsToStore } from '../actions';
import { GET_STRING, GET_STRING_TO_STORE } from '../../../reducers/constants';
// import db from '../../../../server/db';

// getStrings testing seemed extraneous due ot the fact that it doesn't do anything that isn't covered by axios/the backend.
// Testing the backend covers the function, since all it does is return a result from the backend.
// Tested during the sagas.test.js file and axios doesn't seem to run properly on a test server
// - seems the express backend doesn't start up in a test environment

// describe('getStrings returns array of strings', () => {
//   it('should get an array from the database', async () => {
//     const sample = ['bleh', 'aaaaa', 'bbbbbb'];
//     await db.query(`DELETE FROM strings`);
//     await db.query(
//       `INSERT INTO strings (string) VALUES ($1), ($2), ($3)`,
//       sample,
//     );
//     const strings = await getStrings();
//     expect(strings).toEqual(sample);
//   });
// });
describe('getStringAction returns proper action', () => {
  it('should return proper action', () => {
    expect(getStringAction()).toEqual({ type: GET_STRING });
  });
});
describe('getStringsToStore returns proper action', () => {
  it('should return proper action', () => {
    expect(getStringsToStore('blegh')).toEqual({
      type: GET_STRING_TO_STORE,
      payload: 'blegh',
    });
  });
});
// afterAll(async () => {
//   await db.query(`DELETE FROM strings`);
//   await db.end();
// });
