@@ -681,10 +681,10 @@ describe('RemoteConfig', () => {
681681 } ) ;
682682 } ) ;
683683
684- it ( 'should resolve with template when Version updateTime contains only 3 ms places ' , ( ) => {
684+ it ( 'should resolve with template when Version updateTime contains 3 digits in fractional seconds ' , ( ) => {
685685 const response = deepCopy ( REMOTE_CONFIG_RESPONSE ) ;
686686 const versionInfo = deepCopy ( VERSION_INFO ) ;
687- versionInfo . updateTime = '2020-11-03T20:24:15 .203Z' ;
687+ versionInfo . updateTime = '2020-10-03T17:14:10 .203Z' ;
688688 response . version = versionInfo ;
689689 const stub = sinon
690690 . stub ( RemoteConfigApiClient . prototype , operationName )
@@ -703,14 +703,14 @@ describe('RemoteConfig', () => {
703703704704 } ) ;
705705 expect ( version . description ) . to . equal ( 'production version' ) ;
706- expect ( version . updateTime ) . to . equal ( 'Tue , 03 Nov 2020 20:24:15 GMT' ) ;
706+ expect ( version . updateTime ) . to . equal ( 'Sat , 03 Oct 2020 17:14:10 GMT' ) ;
707707 } ) ;
708708 } ) ;
709709
710- it ( 'should resolve with template when Version updateTime contains 6 ms places ' , ( ) => {
710+ it ( 'should resolve with template when Version updateTime contains 6 digits in fractional seconds ' , ( ) => {
711711 const response = deepCopy ( REMOTE_CONFIG_RESPONSE ) ;
712712 const versionInfo = deepCopy ( VERSION_INFO ) ;
713- versionInfo . updateTime = '2020-11-13T17 :01:36.541527Z' ;
713+ versionInfo . updateTime = '2020-08-14T17 :01:36.541527Z' ;
714714 response . version = versionInfo ;
715715 const stub = sinon
716716 . stub ( RemoteConfigApiClient . prototype , operationName )
@@ -729,7 +729,33 @@ describe('RemoteConfig', () => {
729729730730 } ) ;
731731 expect ( version . description ) . to . equal ( 'production version' ) ;
732- expect ( version . updateTime ) . to . equal ( 'Fri, 13 Nov 2020 17:01:36 GMT' ) ;
732+ expect ( version . updateTime ) . to . equal ( 'Fri, 14 Aug 2020 17:01:36 GMT' ) ;
733+ } ) ;
734+ } ) ;
735+
736+ it ( 'should resolve with template when Version updateTime contains 9 digits in fractional seconds' , ( ) => {
737+ const response = deepCopy ( REMOTE_CONFIG_RESPONSE ) ;
738+ const versionInfo = deepCopy ( VERSION_INFO ) ;
739+ versionInfo . updateTime = '2020-11-15T06:57:26.342763941Z' ;
740+ response . version = versionInfo ;
741+ const stub = sinon
742+ . stub ( RemoteConfigApiClient . prototype , operationName )
743+ . resolves ( response ) ;
744+ stubs . push ( stub ) ;
745+
746+ return rcOperation ( )
747+ . then ( ( template ) => {
748+ expect ( template . etag ) . to . equal ( 'etag-123456789012-5' ) ;
749+
750+ const version = template . version ! ;
751+ expect ( version . versionNumber ) . to . equal ( '86' ) ;
752+ expect ( version . updateOrigin ) . to . equal ( 'ADMIN_SDK_NODE' ) ;
753+ expect ( version . updateType ) . to . equal ( 'INCREMENTAL_UPDATE' ) ;
754+ expect ( version . updateUser ) . to . deep . equal ( {
755+ 756+ } ) ;
757+ expect ( version . description ) . to . equal ( 'production version' ) ;
758+ expect ( version . updateTime ) . to . equal ( 'Sun, 15 Nov 2020 06:57:26 GMT' ) ;
733759 } ) ;
734760 } ) ;
735761 }
0 commit comments