File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,16 @@ describe("users", function () {
114114 const { user } = await users . fetchUser ( { githubUsername } ) ;
115115 expect ( user ) . to . haveOwnProperty ( "github_created_at" ) ;
116116 } ) ;
117+
118+ it ( "it should filter out the id field while updating profileDiff" , async function ( ) {
119+ const userData = userDataArray [ 0 ] ;
120+ const { userId } = await users . addOrUpdate ( userData ) ;
121+ const profileDiff = { id : "random-id" , diff : "random-diff" } ;
122+ await users . addOrUpdate ( profileDiff , userId ) ;
123+ const data = ( await userModel . doc ( userId ) . get ( ) ) . data ( ) ;
124+ expect ( data ) . to . haveOwnProperty ( "diff" ) ; // Ensures profile diffs are pushed
125+ expect ( data . id ) . not . equal ( "random-id" ) ; // Ensures id is not added / updated by profile Diffs
126+ } ) ;
117127 } ) ;
118128
119129 describe ( "fetch user details based on discord id" , function ( ) {
You can’t perform that action at this time.
0 commit comments