File tree Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Expand file tree Collapse file tree 2 files changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ module . exports = ( ) => {
2
+ return [
3
+ {
4
+ discordId : "1234567890987543" ,
5
+ first_name : "jhon" ,
6
+ last_name : "doe" ,
7
+ username : "jhon-doe" ,
8
+ github_id : "jhon-doe" ,
9
+ github_display_name : "jhon-doe" ,
10
+ incompleteUserDetails : false ,
11
+ roles : {
12
+ archived : false ,
13
+ in_discord : true ,
14
+ } ,
15
+ tokens : {
16
+ githubAccessToken : "weuytrertyuiiuyrtyui4567yyyuyghy" ,
17
+ } ,
18
+ } ,
19
+ {
20
+ discordId : "8494597689576953" ,
21
+ first_name : "test" ,
22
+ last_name : "user" ,
23
+ username : "test-user" ,
24
+ github_id : "test-user" ,
25
+ github_display_name : "test-user" ,
26
+ incompleteUserDetails : false ,
27
+ roles : {
28
+ archived : false ,
29
+ in_discord : false ,
30
+ } ,
31
+ tokens : {
32
+ githubAccessToken : "weuytrertyuiiuyrtyui4567yyyuyghy" ,
33
+ } ,
34
+ } ,
35
+ {
36
+ first_name : "test" ,
37
+ last_name : "user" ,
38
+ username : "test-user" ,
39
+ github_id : "test-user" ,
40
+ github_display_name : "test-user" ,
41
+ incompleteUserDetails : false ,
42
+ roles : {
43
+ archived : false ,
44
+ in_discord : false ,
45
+ } ,
46
+ tokens : {
47
+ githubAccessToken : "weuytrertyuiiuyrtyui4567yyyuyghy" ,
48
+ } ,
49
+ } ,
50
+ ] ;
51
+ } ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const userData = require("../fixtures/user/user")();
13
13
const profileDiffData = require ( "../fixtures/profileDiffs/profileDiffs" ) ( ) ;
14
14
const superUser = userData [ 4 ] ;
15
15
const searchParamValues = require ( "../fixtures/user/search" ) ( ) ;
16
+ const inDiscordUsers = require ( "../fixtures/user/inDiscord" ) ( ) ;
16
17
17
18
const config = require ( "config" ) ;
18
19
const joinData = require ( "../fixtures/user/join" ) ;
@@ -1071,4 +1072,27 @@ describe("Users", function () {
1071
1072
} ) ;
1072
1073
} ) ;
1073
1074
} ) ;
1075
+
1076
+ describe ( "PATCH /users" , function ( ) {
1077
+ beforeEach ( async function ( ) {
1078
+ await addUser ( inDiscordUsers [ 0 ] ) ;
1079
+ await addUser ( inDiscordUsers [ 1 ] ) ;
1080
+ await addUser ( inDiscordUsers [ 2 ] ) ;
1081
+ } ) ;
1082
+ it ( "returns users with discord id and in_discord false" , function ( done ) {
1083
+ chai
1084
+ . request ( app )
1085
+ . patch ( "/users" )
1086
+ . set ( "Cookie" , `${ cookieName } =${ jwt } ` )
1087
+ . end ( ( err , res ) => {
1088
+ if ( err ) {
1089
+ return done ( err ) ;
1090
+ }
1091
+ expect ( res ) . to . have . status ( 200 ) ;
1092
+ expect ( res . body ) . to . have . length ( 1 ) ;
1093
+ expect ( res . body [ 0 ] . username ) . equal ( "test-user" ) ;
1094
+ return done ( ) ;
1095
+ } ) ;
1096
+ } ) ;
1097
+ } ) ;
1074
1098
} ) ;
You can’t perform that action at this time.
0 commit comments