{"size": 797, "ext": "js", "max_stars_repo_path": "src/modules/create-index/is-wildcard.spec.js", "max_stars_repo_name": "mongodb-js/compass-indexes", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/modules/create-index/is-wildcard.spec.js", "max_issues_repo_name": "mongodb-js/compass-indexes", "max_issues_repo_issues_event_min_datetime": "2019-03-05T16:26:26.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-09T23:15:44.000Z", "max_forks_repo_path": "src/modules/create-index/is-wildcard.spec.js", "max_forks_repo_name": "isabella232/compass-indexes", "max_forks_repo_forks_event_min_datetime": "2021-01-28T11:20:33.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-28T11:20:33.000Z"}
{"max_stars_count": null, "max_issues_count": 104, "max_forks_count": 1, "avg_line_length": 25.7096774194, "max_line_length": 74, "alphanum_fraction": 0.5759096612}
import reducer, {
  INITIAL_STATE,
  toggleIsWildcard,
  TOGGLE_IS_WILDCARD
} from 'modules/create-index/is-wildcard';

describe('create index is wildcard module', () => {
  describe('#reducer', () => {
    context('when an action is provided', () => {
      it('returns the new state', () => {
        expect(reducer(undefined, toggleIsWildcard(true))).to.equal(true);
      });
    });

    context('when an action is not provided', () => {
      it('returns the default state', () => {
        expect(reducer(undefined, {})).to.equal(INITIAL_STATE);
      });
    });
  });

  describe('#toggleIsWildcard', () => {
    it('returns the action', () => {
      expect(toggleIsWildcard(false)).to.deep.equal({
        type: TOGGLE_IS_WILDCARD,
        isWildcard: false
      });
    });
  });
});
