Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7511282
collection.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
819 B
Referenced Files
None
Subscribers
None
collection.test.ts
View Options
import
assert
from
"assert"
;
import
Int
from
"../app/base-chips/field-types/int"
;
import
{
App
}
from
"../main"
;
import
{
withRunningApp
}
from
"../test_utils/with-test-app"
;
import
Collection
from
"./collection"
;
describe
(
"collection router"
,
()
=>
{
it
(
"propertly responds to a GET request to list resources"
,
async
()
=>
withRunningApp
(
(
t
)
=>
class
extends
t
{
collections
=
{
...
App
.
BaseCollections
,
coins
:
new
(
class
extends
Collection
{
fields
=
{
value
:
new
Int
()
};
})(),
};
},
async
({
rest_api
})
=>
{
await
rest_api
.
post
(
"/api/v1/collections/coins"
,
{
value
:
2
});
const
response
=
await
rest_api
.
get
(
"/api/v1/collections/coins"
);
assert
.
ok
(
response
.
items
[
0
].
id
);
assert
.
strictEqual
(
response
.
items
[
0
].
value
,
2
);
}
));
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Jul 21, 00:18 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
800295
Default Alt Text
collection.test.ts (819 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment