Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010686
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
847 B
Referenced Files
None
Subscribers
None
extract-context.test.ts
View Options
import
assert
from
"assert"
;
import
{
withRunningApp
}
from
"../test_utils/with-test-app.js"
;
import
{
assertThrowsAsync
}
from
"../test_utils/assert-throws-async.js"
;
import
type
{
RestAPIError
}
from
"../test_utils/rest-api.js"
;
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"
,
});
await
rest_api
.
login
({
username
:
"any"
,
password
:
"anyanyany"
});
await
assertThrowsAsync
(
()
=>
rest_api
.
get
(
"/api/v1/collections/users/me"
),
// cookie left out intentionally
(
error
:
RestAPIError
)
=>
{
assert
.
strictEqual
(
error
?
.
response
?
.
data
?
.
message
,
"You're not logged in!"
);
}
);
}));
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:46 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
627438
Default Alt Text
extract-context.test.ts (847 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment