Skip to content

Instantly share code, notes, and snippets.

@alexdiliberto
Created July 16, 2015 03:32
Show Gist options
  • Select an option

  • Save alexdiliberto/f3b18c2f4e923f6e8292 to your computer and use it in GitHub Desktop.

Select an option

Save alexdiliberto/f3b18c2f4e923f6e8292 to your computer and use it in GitHub Desktop.
Ember QUnit Test Helper: selectById()
export function selectById(selectId, optionLabel) {
return function() {
const option = findWithAssert(`#${selectId} option:contains('${optionLabel}')`);
fillIn(`#${selectId}`, option.attr('value'));
return find(selectId).focusout();
};
}
andThen(selectById('#selector', 'some option'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment