Skip to content
This repository was archived by the owner on Nov 19, 2021. It is now read-only.

Commit 483c45f

Browse files
committed
#10 #14 main spec file with the integration of routers
1 parent 756357a commit 483c45f

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

oasp4js-sample/src/app/oasp4js-sample.component.spec.ts

+14-11
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ import {
66
inject
77
} from '@angular/core/testing';
88
import { Oasp4jsSampleAppComponent } from '../app/oasp4js-sample.component';
9+
import {ROUTER_DIRECTIVES, Router, Routes} from "@angular/router";
910

10-
beforeEachProviders(() => [Oasp4jsSampleAppComponent]);
11+
describe('[COMPONENT]: Oasp4jsSampleAppComponent', () => {
12+
let component: Oasp4jsSampleAppComponent;
13+
let router: Router;
14+
beforeAll(() => {
15+
router = jasmine.createSpyObj("Router", ['navigate']);
16+
component = new Oasp4jsSampleAppComponent(router);
17+
});
18+
it("should be defined", () => {
19+
expect(component).toBeDefined();
20+
});
1121

12-
describe('App: Oasp4jsSample', () => {
13-
it('should create the app',
14-
inject([Oasp4jsSampleAppComponent], (app: Oasp4jsSampleAppComponent) => {
15-
expect(app).toBeTruthy();
16-
}));
17-
18-
it('should have as title \'oasp4js-sample works!\'',
19-
inject([Oasp4jsSampleAppComponent], (app: Oasp4jsSampleAppComponent) => {
20-
expect(app.title).toEqual('oasp4js-sample works!');
21-
}));
22+
it('should have as title \'oasp4js-sample works!\'', () => {
23+
expect(component.title).toEqual('oasp4js-sample works!');
24+
});
2225
});

0 commit comments

Comments
 (0)