summaryrefslogtreecommitdiff
path: root/app/boot/__tests__/wire-up-components-into_spec.js
blob: 4475cc621b136e9f9a2c58b7a000283475c21e74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as commands from '../../services/commands';
import Api from '../../infrastructure/api';
import Registry from '../../infrastructure/registry';
import WireUpComponentsInto from '../wire-up-components-into';

describe("WireUpComponentsInto", () => {
  let subject = null;
  let registry = null;

  beforeEach(() => {
    registry = new Registry();
    subject = new WireUpComponentsInto(registry);
  });

  describe("#run", () => {
    beforeEach(() => {
      subject.run()
    });

    it ("registers each command", function() {
      results = registry.resolveAll('subscriber');
      expect(results.length).toEqual(3);
    });

    it ("can build the api", function() {
      result = registry.resolve('api');
      expect(result).toBeInstanceOf(Api);
    });
  });
})