File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1125,7 +1125,7 @@ mod tests {
1125
1125
}
1126
1126
1127
1127
#[ tokio:: test]
1128
- async fn cannot_add_component_that_does_not_match_trigger ( ) {
1128
+ async fn can_add_component_with_different_trigger ( ) {
1129
1129
let temp_dir = tempdir ( ) . unwrap ( ) ;
1130
1130
let store = TemplateStore :: new ( temp_dir. path ( ) ) ;
1131
1131
let manager = TemplateManager { store } ;
@@ -1191,12 +1191,14 @@ mod tests {
1191
1191
accept_defaults : false ,
1192
1192
} ;
1193
1193
1194
- template
1195
- . run ( options)
1196
- . silent ( )
1197
- . await
1198
- . expect_err ( "Expected to fail to add component, but it succeeded" ) ;
1194
+ template. run ( options) . silent ( ) . await . unwrap ( ) ;
1199
1195
}
1196
+
1197
+ let spin_toml = tokio:: fs:: read_to_string ( & spin_toml_path) . await . unwrap ( ) ;
1198
+ assert ! ( spin_toml. contains( "[[trigger.redis]]" ) ) ;
1199
+ assert ! ( spin_toml. contains( "[[trigger.http]]" ) ) ;
1200
+ assert ! ( spin_toml. contains( "[component.my-multi-project]" ) ) ;
1201
+ assert ! ( spin_toml. contains( "[component.hello]" ) ) ;
1200
1202
}
1201
1203
1202
1204
#[ tokio:: test]
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ impl Run {
217
217
TemplateVariantInfo :: NewApplication => Ok ( ( ) ) ,
218
218
TemplateVariantInfo :: AddComponent { manifest_path } => {
219
219
match crate :: app_info:: AppInfo :: from_file ( manifest_path) {
220
- Some ( Ok ( app_info) ) => self
220
+ Some ( Ok ( app_info) ) if app_info . manifest_format ( ) == 1 => self
221
221
. template
222
222
. check_compatible_trigger ( app_info. trigger_type ( ) ) ,
223
223
_ => Ok ( ( ) ) , // Fail forgiving - don't block the user if things are under construction
You can’t perform that action at this time.
0 commit comments