@@ -80,6 +80,24 @@ const FIREBASE_MANAGED_COLLECTIONS = [
8080 data : ( ) => ( { pinnedEventIds : [ ] } ) ,
8181 updatedData : ( ) => ( { pinnedEventIds : [ '42' ] } )
8282 } ]
83+ } , {
84+ name : '/users/{userId}/last-connection/self' ,
85+ docInitializations : [ {
86+ name : 'alice' ,
87+ collection : '/users/alice/last-connection' ,
88+ path : '/users/alice/last-connection/self' ,
89+ newDocPath : '/users/alice/last-connection/other' ,
90+ data : ( ) => ( { userLastConnection : "2024-10-27T12:00:00Z" } ) ,
91+ updatedData : ( ) => ( { userLastConnection : "2024-10-27T12:42:00Z" } )
92+ } , {
93+ name : 'fred' ,
94+ collection : '/users/fred/last-connection' ,
95+ path : '/users/fred/last-connection/self' ,
96+ newDocPath : '/users/fred/last-connection/other' ,
97+ data : ( ) => ( { userLastConnection : "2024-10-27T12:00:00Z" } ) ,
98+ updatedData : ( ) => ( { userLastConnection : "2024-10-27T12:42:00Z" } )
99+ } ]
100+
83101 } , {
84102 name : '/users/{userId}/events/{eventId}' ,
85103 docInitializations : [ {
@@ -802,6 +820,31 @@ const COLLECTIONS: CollectionDescriptor[] = [{
802820 list : false , createDoc : false , delete : false , get : false , update : false , createNew : false
803821 } , 'alice' )
804822 }
823+ } , {
824+ name : "/users/{userId}/last-connection" ,
825+ aroundTests : ( userContext : UserContext ) => match ( userContext )
826+ . with ( { name : "unauthenticated user" } , ( ) => ( {
827+ beforeEach : [ ] ,
828+ afterEach : [ ] ,
829+ } ) )
830+ . with ( { name : "fred user" } , ( ) => ( {
831+ beforeEach : [ ] ,
832+ afterEach : [ ] ,
833+ } ) ) . run ( ) ,
834+ tests : ( userContext : UserContext ) => {
835+ ensureCollectionFollowAccessPermissions ( '/users/{userId}/last-connection/self' , userContext ,
836+ {
837+ createDoc : userContext . name === 'fred user' ,
838+ get : false , update : userContext . name === 'fred user' ,
839+ list : false , delete : false , createNew : false ,
840+ } , 'fred' )
841+
842+ ensureCollectionFollowAccessPermissions ( '/users/{userId}/last-connection/self' , userContext ,
843+ {
844+ get : false , update : false , createDoc : false ,
845+ list : false , delete : false , createNew : false ,
846+ } , 'alice' )
847+ }
805848} , {
806849 name : "/users/{userId}/preferences" ,
807850 aroundTests : ( userContext : UserContext ) => match ( userContext )
0 commit comments