Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90832998
users.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, Nov 5, 04:40
Size
623 B
Mime Type
text/x-c++
Expires
Thu, Nov 7, 04:40 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22142709
Attached To
R2664 SHRINE MedCo Fork
users.spec.js
View Options
import
{
Users
}
from
'../../src/users'
;
class
HttpStub
{
fetch
(
url
)
{
var
response
=
this
.
itemStub
;
this
.
url
=
url
;
return
new
Promise
((
resolve
)
=>
{
resolve
({
json
:
()
=>
response
});
});
}
configure
(
func
)
{
}
}
describe
(
'the Users module'
,
()
=>
{
it
(
'sets fetch response to users'
,
(
done
)
=>
{
var
http
=
new
HttpStub
();
var
sut
=
new
Users
(
http
);
var
itemStubs
=
[
1
];
var
itemFake
=
[
2
];
http
.
itemStub
=
itemStubs
;
sut
.
activate
().
then
(()
=>
{
expect
(
sut
.
users
).
toBe
(
itemStubs
);
expect
(
sut
.
users
).
not
.
toBe
(
itemFake
);
done
();
});
});
});
Event Timeline
Log In to Comment