Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63840856
app.spec.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, May 22, 20:13
Size
1 KB
Mime Type
text/x-c++
Expires
Fri, May 24, 20:13 (2 d)
Engine
blob
Format
Raw Data
Handle
17825754
Attached To
R2664 SHRINE MedCo Fork
app.spec.js
View Options
import {App} from '../../src/app';
class RouterStub {
configure(handler) {
handler(this);
}
map(routes) {
this.routes = routes;
}
}
describe('the App module', () => {
var sut;
var mockedRouter;
beforeEach(() => {
mockedRouter = new RouterStub();
sut = new App();
sut.configureRouter(mockedRouter, mockedRouter);
});
it('contains a router property', () => {
expect(sut.router).toBeDefined();
});
it('configures the router title', () => {
expect(sut.router.title).toEqual('Aurelia');
});
it('should have a welcome route', () => {
expect(sut.router.routes).toContain({ route: ['', 'welcome'], name: 'welcome', moduleId: 'welcome', nav: true, title: 'Welcome' });
});
it('should have a users route', () => {
expect(sut.router.routes).toContain({ route: 'users', name: 'users', moduleId: 'users', nav: true, title: 'Github Users' });
});
it('should have a child router route', () => {
expect(sut.router.routes).toContain({ route: 'child-router', name: 'child-router', moduleId: 'child-router', nav: true, title: 'Child Router' });
});
});
Event Timeline
Log In to Comment