@@ -2054,6 +2054,35 @@ function genericLocalStoreTests(
2054
2054
. finish ( ) ;
2055
2055
} ) ;
2056
2056
2057
+ it ( 'updates createTime upon receiving a remote event with a new createTime' , ( ) => {
2058
+ if ( gcIsEager ) {
2059
+ return ;
2060
+ }
2061
+
2062
+ return expectLocalStore ( )
2063
+ . after ( setMutation ( 'col/doc1' , { foo : 'newBar' } ) )
2064
+ . afterAcknowledgingMutation ( { documentVersion : 13 } )
2065
+ . afterExecutingQuery ( query ( 'col' ) )
2066
+ . toReturnChangedWithDocComparator (
2067
+ compareDocsWithCreateTime ,
2068
+ doc ( 'col/doc1' , 13 , { foo : 'newBar' } , 13 ) . setHasCommittedMutations ( )
2069
+ )
2070
+ . toContain (
2071
+ doc ( 'col/doc1' , 13 , { foo : 'newBar' } , 13 ) . setHasCommittedMutations ( ) ,
2072
+ compareDocsWithCreateTime
2073
+ )
2074
+ . after ( docAddedRemoteEvent ( doc ( 'col/doc1' , 14 , { foo : 'baz' } , 5 ) , [ 2 ] ) )
2075
+ . toReturnChangedWithDocComparator (
2076
+ compareDocsWithCreateTime ,
2077
+ doc ( 'col/doc1' , 14 , { foo : 'baz' } , 5 )
2078
+ )
2079
+ . toContain (
2080
+ doc ( 'col/doc1' , 14 , { foo : 'baz' } , 5 ) ,
2081
+ compareDocsWithCreateTime
2082
+ )
2083
+ . finish ( ) ;
2084
+ } ) ;
2085
+
2057
2086
it ( 'saves updateTime as createTime when recreating a deleted doc' , async ( ) => {
2058
2087
if ( gcIsEager ) {
2059
2088
return ;
0 commit comments