How to test component methods?

I have component with one method and service, which can run functions for some components.

export default Ember.Component.extend({
  foo: false,

  bar() {
    this.set('foo', true);

  someService: Ember.inject.service('some-service'),

  didInsertElement: function () {
    const someService = this.get('someService');

export default Ember.Service.extend({
  components: [],
  registerComponent: function (component) {
    let components = this.get('components');
  runBar(index) {
    let components = this.get('components');
  1. How can I write tests for bar() method?
  2. And also how can I write tests for this service?
  3. Or how can I refactor this approach?