diff --git a/spec/components/hello.spec.ts b/spec/components/hello.spec.ts
new file mode 100644
index 0000000..44420ac
--- /dev/null
+++ b/spec/components/hello.spec.ts
@@ -0,0 +1,57 @@
+/// <reference path="../../typings/index.d.ts"/>
+
+import {Router} from '@angular/router';
+import {HelloComponent} from '../../src/app/hello';
+import {LogoutComponent} from '../../src/app/components/logout/logout.component';
+import {StyleConfig} from '../../src/app/config/style.config';
+import { Http, BaseRequestOptions } from '@angular/http';
+import {CookieService} from 'angular2-cookie/services/cookies.service';
+import {XosHttp} from '../../src/app/services/rest/xoshttp.service';
+import {InstanceStore} from '../../src/app/services/stores/instance.store';
+import {GlobalEvent} from '../../src/app/services/websockets/websocket.global';
+import {AuthService} from '../../src/app/services/rest/auth.service';
+import {InstanceService} from '../../src/app/services/rest/instance.service';
+import {SliceService} from '../../src/app/services/rest/slices.service';
+import {TestBed, async} from '@angular/core/testing';
+import {MockBackend} from '@angular/http/testing';
+
+describe('hello component', () => {
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [
+        HelloComponent,
+        LogoutComponent
+      ],
+      providers: [
+        {
+          provide: Http,
+          useFactory: (mockBackend, options) => {
+            return new Http(mockBackend, options);
+          },
+          deps: [MockBackend, BaseRequestOptions]
+        },
+        MockBackend,
+        BaseRequestOptions,
+        CookieService,
+        {
+          provide: Router,
+          useClass: class { navigate = jasmine.createSpy('navigate'); }
+        },
+        XosHttp,
+        InstanceStore,
+        GlobalEvent,
+        AuthService,
+        InstanceService,
+        SliceService
+      ]
+    });
+    TestBed.compileComponents();
+  }));
+
+  it('should render hello world', () => {
+    const fixture = TestBed.createComponent(HelloComponent);
+    fixture.detectChanges();
+    const hello = fixture.nativeElement;
+    expect(hello.querySelector('h1').textContent).toBe(`Hello ${StyleConfig.projectName}!`);
+  });
+});
diff --git a/spec/services/store.service.spec.ts b/spec/services/store.service.spec.ts
new file mode 100644
index 0000000..a477817
--- /dev/null
+++ b/spec/services/store.service.spec.ts
@@ -0,0 +1,89 @@
+///<reference path="../../typings/globals/jasmine/index.d.ts"/>
+
+import {ObservableCollectionHandler} from '../../src/app/services/helpers/store.service';
+import {IWSEvent} from '../../src/app/interfaces/ws.interface';
+import {BehaviorSubject} from 'rxjs';
+
+describe('Service: Observable Collection Handler', () => {
+
+  let subject: BehaviorSubject<any>;
+  let observable;
+
+  beforeEach(() => {
+    subject = new BehaviorSubject([]);
+    observable = subject.asObservable();
+  });
+
+  it('Should have an update method', () => {
+    expect(ObservableCollectionHandler.update).toBeDefined();
+  });
+
+  it('should add an element to the observable', (done) => {
+    const event: IWSEvent = {
+      model: 'Test',
+      msg: {
+        pk: 1,
+        changed_fields: [],
+        object: {id: 1, foo: 'bar'}
+      }
+    };
+
+    ObservableCollectionHandler.update(event, subject);
+
+    subject.subscribe(
+      (collection: any[]) => {
+        expect(collection.length).toBe(1);
+        expect(collection[0].foo).toEqual('bar');
+        done();
+      }
+    );
+  });
+
+  describe('when the subject already have content', () => {
+    beforeEach(() => {
+      subject.next([{id: 1, foo: 'bar'}, {id: 2, foo: 'baz'}]);
+    });
+
+    it('should update an element', (done) => {
+      const event: IWSEvent = {
+        model: 'Test',
+        msg: {
+          pk: 1,
+          changed_fields: [],
+          object: {id: 1, foo: 'updated'}
+        }
+      };
+
+      ObservableCollectionHandler.update(event, subject);
+
+      subject.subscribe(
+        (collection: any[]) => {
+          expect(collection.length).toBe(2);
+          expect(collection[0].foo).toEqual('updated');
+          done();
+        }
+      );
+    });
+
+    it('should delete an element', (done) => {
+      const event: IWSEvent = {
+        model: 'Test',
+        msg: {
+          pk: 1,
+          changed_fields: ['deleted'],
+          object: {id: 1, foo: 'deleted'}
+        }
+      };
+
+      ObservableCollectionHandler.update(event, subject);
+
+      subject.subscribe(
+        (collection: any[]) => {
+          expect(collection.length).toBe(1);
+          expect(collection[0].foo).toEqual('baz');
+          done();
+        }
+      );
+    });
+  });
+});
