Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22405683
context.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
648 B
Referenced Files
None
Subscribers
None
context.test.ts
View Options
import
{
withRunningApp
}
from
"./test_utils/with-test-app.js"
;
import
{
default
as
Context
}
from
"./context.js"
;
import
assert
from
"assert"
;
describe
(
"context"
,
()
=>
{
it
(
"Exposes user roles in getRoles() method"
,
async
()
=>
{
return
withRunningApp
(
(
t
)
=>
{
return
t
;
},
async
({
app
})
=>
{
const
user
=
await
app
.
collections
.
users
.
create
(
new
app
.
SuperContext
(),
{
username
:
"admin"
,
password
:
"password"
,
roles
:
[{
role
:
"admin"
}],
}
);
const
context
=
new
Context
(
app
,
Date
.
now
(),
user
.
id
);
assert
.
deepStrictEqual
(
await
context
.
getRoles
(),
[
"admin"
]);
}
);
});
});
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 19:57 (6 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1228523
Default Alt Text
context.test.ts (648 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline