File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
crates/model/src/deployment_audit_log Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -87,3 +87,25 @@ impl TryFrom<SerializedDeveloperIndexConfig> for DeveloperIndexConfig {
8787}
8888
8989codegen_convex_serialization ! ( DeveloperIndexConfig , SerializedDeveloperIndexConfig ) ;
90+
91+ #[ cfg( test) ]
92+ mod tests {
93+ use common:: bootstrap_model:: index:: database_index:: IndexedFields ;
94+
95+ use super :: * ;
96+
97+ #[ test]
98+ fn test_developer_index_config_serialization ( ) -> anyhow:: Result < ( ) > {
99+ let config = DeveloperIndexConfig :: Database ( DatabaseIndexSpec {
100+ fields : IndexedFields :: creation_time ( ) ,
101+ } ) ;
102+ let serialized = SerializedDeveloperIndexConfig :: try_from ( config. clone ( ) ) . unwrap ( ) ;
103+ let json = serde_json:: to_value ( & serialized) ?;
104+ let expected = serde_json:: json!( {
105+ "type" : "database" ,
106+ "fields" : [ "_creationTime" ] ,
107+ } ) ;
108+ assert_eq ! ( json, expected) ;
109+ Ok ( ( ) )
110+ }
111+ }
You can’t perform that action at this time.
0 commit comments