github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/ui-v2/tests/unit/routes/index-test.js (about)

     1  import { moduleFor } from 'ember-qunit';
     2  // import Service from '@ember/service';
     3  import test from 'ember-sinon-qunit/test-support/test';
     4  
     5  moduleFor('route:index', 'Unit | Route | index', {
     6    // Specify the other units that are required for this test.
     7    needs: ['service:repository/dc'],
     8  });
     9  
    10  test('it exists', function(assert) {
    11    let route = this.subject();
    12    assert.ok(route);
    13  });
    14  // test('model calls findAll', function(assert) {
    15  //   const expected = true;
    16  //   const findAll = this.stub();
    17  //   findAll.returns(expected);
    18  //   this.register(
    19  //     'service:dc',
    20  //     Service.extend({
    21  //       findAll: findAll,
    22  //     })
    23  //   );
    24  //   const route = this.subject();
    25  //   const actual = route.model();
    26  //   assert.equal(actual, expected);
    27  //   assert.ok(findAll.calledOnce);
    28  // });
    29  // test('it transitions straight away if there is only one datacenter', function(assert) {
    30  //   const route = this.subject();
    31  //   const transitionTo = this.stub(route, 'transitionTo');
    32  //   const get = this.stub();
    33  //   get.returns(1);
    34  //   route.afterModel({ get: get });
    35  //   get.returns(2);
    36  //   route.afterModel({ get: get });
    37  //   assert.ok(transitionTo.calledOnce);
    38  // });