Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995809
sessions.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
960 B
Referenced Files
None
Subscribers
None
sessions.test.ts
View Options
import
assert
from
"assert"
;
import
{
withRunningApp
}
from
"../../test_utils/with-test-app"
;
describe
(
"sessions"
,
()
=>
{
it
(
"handles login and logout properly"
,
()
=>
withRunningApp
(
(
app
)
=>
app
,
async
({
app
})
=>
{
const
user
=
await
app
.
collections
.
users
.
suCreate
({
username
:
"useruser"
,
password
:
"password"
,
});
const
session_id
=
await
app
.
collections
.
sessions
.
login
(
"useruser"
,
"password"
);
const
{
items
:
[
session
],
}
=
await
app
.
collections
.
sessions
.
suList
()
.
filter
({
"session-id"
:
session_id
})
.
fetch
();
assert
.
strictEqual
(
session
.
get
(
"user"
),
user
.
id
);
await
app
.
collections
.
sessions
.
logout
(
new
app
.
SuperContext
(),
session_id
);
const
result_after_logout
=
await
app
.
collections
.
sessions
.
suList
()
.
filter
({
"session-id"
:
session_id
})
.
fetch
();
assert
.
strictEqual
(
result_after_logout
.
items
.
length
,
0
);
}
));
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Mon, Dec 23, 19:55 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556966
Default Alt Text
sessions.test.ts (960 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment