<commit_before>// @flow
import { shallow } from 'enzyme';
import React from 'react';
import { InputLocation } from '../InputLocation';

describe('InputLocation', () => {
  describe('handle location input', () => {
    it('updates the value of the input', () => {
      const wrapper = shallow(
        <InputLocation placeholder="Location" apiKey="fakeKey" />,
      );
      const value = 'Test Location';

      wrapper
        .find('LocationAutocomplete')
        .simulate('change', { target: { value } });

      expect(wrapper.find('LocationAutocomplete').props().value).toEqual(value);
    });
  });
});<commit_msg>Add missing test for InputLocation<commit_after>// @flow
import { shallow } from 'enzyme';
import React from 'react';
import { InputLocation } from '../InputLocation';

describe('InputLocation', () => {
  describe('has no initialized value', () => {
    it('updates the value of the input', () => {
      const wrapper = shallow(
        <InputLocation placeholder="Location" apiKey="fakeKey" id="fakeId" />,
      );
      const value = 'Test Location';
      wrapper
        .find('LocationAutocomplete')
        .simulate('change', { target: { value } });
      expect(wrapper.find('LocationAutocomplete').props().value).toEqual(value);
    });
  });

  describe('has an initialized value', () => {
    it('updates the value of the input', () => {
      const initializedValue = 'Hey';
      const wrapper = shallow(
        <InputLocation
          placeholder="Location"
          apiKey="fakeKey"
          id="fakeId"
          value={initializedValue}
        />,
      );
      expect(wrapper.find('LocationAutocomplete').props().value).toEqual(
        initializedValue,
      );
      const value = 'Test Location';
      wrapper
        .find('LocationAutocomplete')
        .simulate('change', { target: { value } });
      expect(wrapper.find('LocationAutocomplete').props().value).toEqual(value);
    });
  });
});
{'fraction_non_alphanumeric': 0.16342213114754098, 'fraction_numerical': 0.0, 'mean_word_length': 2.9375, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, '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': '415423', 'n_tokens_mistral': 527, 'n_tokens_neox': 518, 'n_words': 119}