@@ -26,12 +26,12 @@ describe("LeetCode", { timeout: 15_000 }, () => {
2626            await  res . clone ( ) . json ( ) ; 
2727        } ) ; 
2828
29-         it ( "should be able to get user profile" ,  async  ( )  =>  { 
29+         it ( "should be able to get a  user's  profile" ,  async  ( )  =>  { 
3030            const  user  =  await  lc . user ( "jacoblincool" ) ; 
3131            expect ( user . matchedUser ?. username . toLowerCase ( ) ) . toBe ( "jacoblincool" ) ; 
3232        } ) ; 
3333
34-         it ( "should be able to get user's recent submissions" ,  async  ( )  =>  { 
34+         it ( "should be able to get a  user's recent submissions" ,  async  ( )  =>  { 
3535            const  recent_submissions  =  await  lc . recent_submissions ( "jacoblincool" ,  10 ) ; 
3636            expect ( recent_submissions . length ) . toBe ( 10 ) ; 
3737        } ) ; 
@@ -52,11 +52,18 @@ describe("LeetCode", { timeout: 15_000 }, () => {
5252            expect ( data . allQuestionsCount . length ) . toBe ( 4 ) ; 
5353        } ) ; 
5454
55-         it ( "should be not able to get user's  submissions" ,  async  ( )  =>  { 
55+         it ( "should be not able to get own  submissions" ,  async  ( )  =>  { 
5656            await  expect ( lc . submissions ( {  limit : 30 ,  offset : 0  } ) ) . rejects . toThrow ( ) ; 
5757        } ) ; 
5858
59-         it ( "should be able to get user's contest informations" ,  async  ( )  =>  { 
59+         it ( "should be able to get own information" ,  async  ( )  =>  { 
60+             const  user  =  await  lc . whoami ( ) ; 
61+             expect ( user . userId ) . toBe ( null ) ; 
62+             expect ( user . username ) . toBe ( "" ) ; 
63+             expect ( user . isSignedIn ) . toBe ( false ) ; 
64+         } ) ; 
65+ 
66+         it ( "should be able to get a user's contest informations" ,  async  ( )  =>  { 
6067            const  contests  =  await  lc . user_contest_info ( "lapor" ) ; 
6168            expect ( contests . userContestRanking . rating ) . toBeGreaterThan ( 1500 ) ; 
6269            expect ( contests . userContestRankingHistory . length ) . toBeGreaterThan ( 0 ) ; 
@@ -92,15 +99,15 @@ describe("LeetCode", { timeout: 15_000 }, () => {
9299        } ) ; 
93100
94101        it . skipIf ( ! process . env [ "TEST_LEETCODE_SESSION" ] ) ( 
95-             "should be able to get user's  submissions" , 
102+             "should be able to get own  submissions" , 
96103            async  ( )  =>  { 
97104                const  submissions  =  await  lc . submissions ( {  limit : 100 ,  offset : 0  } ) ; 
98105                expect ( submissions . length ) . toBe ( 100 ) ; 
99106            } , 
100107        ) ; 
101108
102109        it . skipIf ( ! process . env [ "TEST_LEETCODE_SESSION" ] ) ( 
103-             "should be able to get user's  information" , 
110+             "should be able to get own  information" , 
104111            async  ( )  =>  { 
105112                const  user  =  await  lc . whoami ( ) ; 
106113                expect ( typeof  user . userId ) . toBe ( "number" ) ; 
0 commit comments