Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79554977
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
Tue, Aug 27, 02:20
Size
1 KB
Mime Type
text/x-c++
Expires
Thu, Aug 29, 02:20 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20203130
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