File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,12 @@ describe('User', function() {
7373 } ) ;
7474 } ) . to . throw ( User . msg_tokenAuthedInTheFuture ) ;
7575 } ) ;
76+
77+ it ( 'should keep reference to passed-in auth' , ( ) => {
78+ const user = new User ( auth , { } ) ;
79+ auth . autoFlush ( false ) ;
80+ expect ( user . _auth . flushDelay ) . to . equal ( false ) ;
81+ } ) ;
7682 } ) ;
7783
7884 describe ( '#clone' , function ( ) {
@@ -84,6 +90,13 @@ describe('User', function() {
8490 u2 . customClaims . claim1 = 'value2' ;
8591 expect ( u1 . customClaims ) . to . deep . equal ( ogClaims ) ;
8692 } ) ;
93+
94+ it ( 'preserves reference to auth' , ( ) => {
95+ const u1 = new User ( auth , { } ) ;
96+ const u2 = u1 . clone ( ) ;
97+ u1 . _auth . autoFlush ( false ) ;
98+ expect ( u2 . _auth . flushDelay ) . to . equal ( u1 . _auth . flushDelay ) ;
99+ } ) ;
87100 } ) ;
88101
89102 describe ( '#delete' , function ( ) {
You can’t perform that action at this time.
0 commit comments