Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995850
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
817 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
type
{
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"
,
});
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, Dec 23, 22:11 (23 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556978
Default Alt Text
extract-context.test.ts (817 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment