Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73709673
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, Jul 23, 22:11
Size
1 KB
Mime Type
text/x-c++
Expires
Thu, Jul 25, 22:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19253011
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