@@ -46,6 +46,7 @@ describe("Logs", function () {
46
46
const query = { } ;
47
47
48
48
const data = await logsQuery . fetchLogs ( query , type ) ;
49
+
49
50
expect ( data ) . to . be . an ( "array" ) . with . lengthOf ( 0 ) ;
50
51
} ) ;
51
52
it ( "Should fetch all archived logs" , async function ( ) {
@@ -55,7 +56,7 @@ describe("Logs", function () {
55
56
await logsQuery . addLog ( type , meta , body ) ;
56
57
const data = await logsQuery . fetchLogs ( query , type ) ;
57
58
58
- expect ( data ) . to . be . an ( "array" ) . with . lengthOf ( 1 ) ;
59
+ expect ( data ) . to . be . an ( "array" ) . with . lengthOf . greaterThan ( 0 ) ;
59
60
expect ( data [ 0 ] ) . to . have . property ( "timestamp" ) . that . is . an ( "object" ) ;
60
61
expect ( data [ 0 ] . timestamp ) . to . have . property ( "_seconds" ) . that . is . a ( "number" ) ;
61
62
expect ( data [ 0 ] . timestamp ) . to . have . property ( "_nanoseconds" ) . that . is . a ( "number" ) ;
@@ -65,12 +66,12 @@ describe("Logs", function () {
65
66
it ( "Should fetch all archived logs for given username" , async function ( ) {
66
67
const { type, meta, body } = logsData . archivedUserDetailsModal [ 0 ] ;
67
68
const query = {
68
- username : meta . username ,
69
+ userId : meta . userId ,
69
70
} ;
70
71
await logsQuery . addLog ( type , meta , body ) ;
71
72
const data = await logsQuery . fetchLogs ( query , type ) ;
72
73
73
- expect ( data ) . to . be . an ( "array" ) . to . have . lengthOf . greaterThan ( 0 ) ;
74
+ expect ( data ) . to . be . an ( "array" ) . with . lengthOf . greaterThan ( 0 ) ;
74
75
expect ( data [ 0 ] ) . to . have . property ( "timestamp" ) . that . is . an ( "object" ) ;
75
76
expect ( data [ 0 ] . timestamp ) . to . have . property ( "_seconds" ) . that . is . a ( "number" ) ;
76
77
expect ( data [ 0 ] . timestamp ) . to . have . property ( "_nanoseconds" ) . that . is . a ( "number" ) ;
@@ -80,7 +81,7 @@ describe("Logs", function () {
80
81
it ( "Should throw response status 404, if username is incorrect in the query" , async function ( ) {
81
82
const { type, meta, body } = logsData . archivedUserDetailsModal [ 0 ] ;
82
83
const query = {
83
- username : "TEST_USERNAME " , // incorrect username
84
+ userId : "1234_test " , // incorrect username
84
85
} ;
85
86
await logsQuery . addLog ( type , meta , body ) ;
86
87
const data = await logsQuery . fetchLogs ( query , type ) ;
0 commit comments