Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3893784
extract-context.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
953 B
Referenced Files
None
Subscribers
None
extract-context.test.ts
View Options
import
assert
from
"assert"
;
import
{
withRunningApp
}
from
"../test_utils/with-test-app"
;
import
{
assertThrowsAsync
}
from
"../test_utils/assert-throws-async"
;
import
{
AxiosError
}
from
"axios"
;
describe
(
"Extract context"
,
()
=>
{
it
(
"Behaves correctly when the session cookie is missing"
,
async
()
=>
withRunningApp
(
null
,
async
({
app
,
rest_api
})
=>
{
const
user
=
await
app
.
collections
.
users
.
suCreate
({
username
:
"any"
,
password
:
"anyanyany"
,
email
:
"any@example.com"
,
roles
:
[],
});
await
app
.
collections
[
"user-roles"
].
suCreate
({
role
:
"admin"
,
user
:
user
.
id
,
});
await
rest_api
.
login
({
username
:
"any"
,
password
:
"anyanyany"
});
await
assertThrowsAsync
(
()
=>
rest_api
.
get
(
"/api/v1/collections/users/me"
),
// cookie left out intentionally
(
error
:
AxiosError
)
=>
{
assert
.
strictEqual
(
error
?
.
response
?
.
data
?
.
message
,
"You're not logged in!"
);
}
);
}));
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, May 19, 00:55 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
644756
Default Alt Text
extract-context.test.ts (953 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment