@@ -111,30 +111,75 @@ async function runTests(testEnv) {
111
111
) ;
112
112
113
113
/** Read and write operations on associations **/
114
- /* await assertSucceeds(
114
+ await assertSucceeds (
115
115
setDoc (
116
116
doc ( aliceDb , `/associations/${ aliceAssociation . uid } ` ) ,
117
117
aliceAssociation
118
118
)
119
119
) ;
120
- await assertFails(setDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`), { ...aliceAssociation, uid: "other" }));
121
- await assertSucceeds(getDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`)));
122
- await assertFails(updateDoc(doc(aliceDb, `/associations/${otherAssociation.uid}`), aliceAssociation));
123
- await assertFails(setDoc(doc(aliceDb, `/associations/new-association`), { ...aliceAssociation, uid: "new-association" }));
124
- await assertSucceeds(updateDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`), { ...aliceAssociation, name: "New name" }));
125
- await assertSucceeds(updateDoc(doc(aliceDb, `/associations/${otherAssociation.uid}`), { ...otherAssociation, followersCount: 1 }));
126
- await assertSucceeds(updateDoc(doc(aliceDb, `/associations/${otherAssociation.uid}`), { ...otherAssociation, followersCount: 0 }));
127
- await assertFails(updateDoc(doc(aliceDb, `/associations/${otherAssociation.uid}`), { ...otherAssociation, followersCount: 1000 }));
120
+ await assertFails (
121
+ setDoc ( doc ( aliceDb , `/associations/${ aliceAssociation . uid } ` ) , {
122
+ ...aliceAssociation ,
123
+ uid : "other" ,
124
+ } )
125
+ ) ;
126
+ await assertSucceeds (
127
+ getDoc ( doc ( aliceDb , `/associations/${ aliceAssociation . uid } ` ) )
128
+ ) ;
129
+ await assertFails (
130
+ updateDoc (
131
+ doc ( aliceDb , `/associations/${ otherAssociation . uid } ` ) ,
132
+ aliceAssociation
133
+ )
134
+ ) ;
135
+ await assertFails (
136
+ setDoc ( doc ( aliceDb , `/associations/new-association` ) , {
137
+ ...aliceAssociation ,
138
+ uid : "new-association" ,
139
+ } )
140
+ ) ;
141
+ await assertSucceeds (
142
+ updateDoc ( doc ( aliceDb , `/associations/${ aliceAssociation . uid } ` ) , {
143
+ ...aliceAssociation ,
144
+ name : "New name" ,
145
+ } )
146
+ ) ;
147
+ await assertSucceeds (
148
+ updateDoc ( doc ( aliceDb , `/associations/${ otherAssociation . uid } ` ) , {
149
+ ...otherAssociation ,
150
+ followersCount : 1 ,
151
+ } )
152
+ ) ;
153
+ await assertSucceeds (
154
+ updateDoc ( doc ( aliceDb , `/associations/${ otherAssociation . uid } ` ) , {
155
+ ...otherAssociation ,
156
+ followersCount : 0 ,
157
+ } )
158
+ ) ;
159
+ await assertFails (
160
+ updateDoc ( doc ( aliceDb , `/associations/${ otherAssociation . uid } ` ) , {
161
+ ...otherAssociation ,
162
+ followersCount : 1000 ,
163
+ } )
164
+ ) ;
128
165
await assertSucceeds ( getDocs ( collection ( aliceDb , `/associations` ) ) ) ;
129
- await assertFails(deleteDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`)));
130
- await assertFails(setDoc(doc(aliceDb, `/associations/new-association`), aliceAssociation));
131
- await assertFails(setDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`), {
132
- uid: aliceAssociation.uid
133
- }));
134
- await assertFails(setDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`), {
135
- ...aliceAssociation,
136
- members: "invalid type"
137
- }));*/
166
+ await assertFails (
167
+ deleteDoc ( doc ( aliceDb , `/associations/${ aliceAssociation . uid } ` ) )
168
+ ) ;
169
+ await assertFails (
170
+ setDoc ( doc ( aliceDb , `/associations/new-association` ) , aliceAssociation )
171
+ ) ;
172
+ /*await assertFails(
173
+ setDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`), {
174
+ uid: aliceAssociation.uid,
175
+ })
176
+ );
177
+ await assertFails(
178
+ setDoc(doc(aliceDb, `/associations/${aliceAssociation.uid}`), {
179
+ ...aliceAssociation,
180
+ members: "invalid type",
181
+ })
182
+ );*/
138
183
139
184
/** Read and write operations on events **/
140
185
/*await assertSucceeds(setDoc(doc(aliceDb, `/events/${aliceEvent.uid}`), aliceEvent));
0 commit comments