Skip to content

Commit 9f10b5b

Browse files
committed
tests(api): increase coverage of tests to sessions events on store
1 parent e0c8276 commit 9f10b5b

File tree

4 files changed

+522
-2
lines changed

4 files changed

+522
-2
lines changed

api/services/session_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ func TestDeactivateSession(t *testing.T) {
232232
uid: models.UID("_uid"),
233233
requiredMocks: func() {
234234
mock.On("SessionGet", ctx, models.UID("_uid")).
235-
Return(nil, goerrors.New("get error")).Once()
235+
Return(nil, errors.New("get error")).Once()
236236
},
237-
expected: NewErrSessionNotFound("_uid", goerrors.New("get error")),
237+
expected: NewErrSessionNotFound("_uid", errors.New("get error")),
238238
},
239239
{
240240
name: "fails",
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"sessions_events": {
3+
"6862c1d617cc3c27e6c77995": {
4+
"_id": "6862c1d617cc3c27e6c77995",
5+
"session": "a3b0431f5df6a7827945d2e34872a5c781452bc36de42f8b1297fd9ecb012f68",
6+
"type": "pty-req",
7+
"timestamp": "2023-01-02T12:00:00.000Z",
8+
"data": {
9+
"term": "screen-256color",
10+
"columns": 211,
11+
"rows": 47,
12+
"width": 1899,
13+
"height": 940,
14+
"modelist": ""
15+
},
16+
"seat": 0
17+
},
18+
"6862c1d617cc3c27e6c77996": {
19+
"_id": "6862c1d617cc3c27e6c77996",
20+
"session": "a3b0431f5df6a7827945d2e34872a5c781452bc36de42f8b1297fd9ecb012f68",
21+
"type": "shell",
22+
"timestamp": "2023-01-02T12:01:00.000Z",
23+
"data": "",
24+
"seat": 0
25+
},
26+
"6862c1db17cc3c27e6c779d1": {
27+
"_id": "6862c1db17cc3c27e6c779d1",
28+
"session": "a3b0431f5df6a7827945d2e34872a5c781452bc36de42f8b1297fd9ecb012f68",
29+
"type": "exit-status",
30+
"timestamp": "2023-01-02T12:02:00.000Z",
31+
"data": "AAAAAA==",
32+
"seat": 0
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)