<commit_before>import {lookupComponent} from './utils/lookup';
import findComponentElements from './utils/find-component-elements';

export function clickComponent(app, expectation, selector){
  var container = app.container;
  var Component = lookupComponent(container, expectation);

  if (!Component) {
    ok(false, 'No Component called ' + expectation + ' exists.');
    return;
  }

  var elements = findComponentElements(container, Component);
  var context = app.$(elements);

  return app.testHelpers.click(selector, context);
}<commit_msg>fix(clickComponent): lookupFactory `undefined` error<commit_after>import {lookupComponent} from './utils/lookup';
import findComponentElements from './utils/find-component-elements';

export function clickComponent(app, expectation, selector){
  var container;
  if (app.__container__) {
    container = app.__container__;
  } else {
    container = app;
  }
  var Component = lookupComponent(container, expectation);

  if (!Component) {
    ok(false, 'No Component called ' + expectation + ' exists.');
    return;
  }

  var elements = findComponentElements(container, Component);
  var context = app.$(elements);

  return app.testHelpers.click(selector, context);
}
{'fraction_non_alphanumeric': 0.12223133716160788, 'fraction_numerical': 0.0, 'mean_word_length': 4.922330097087379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6975000', 'n_tokens_mistral': 321, 'n_tokens_neox': 317, 'n_words': 87}