Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 0111f7f

Browse files
committed
chore(dal): Ensuring we test the SchemaVariant:all_funcs call
1 parent 0e43468 commit 0111f7f

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

  • lib/dal/tests/integration_test/schema/variant

lib/dal/tests/integration_test/schema/variant/view.rs

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use dal::{DalContext, SchemaVariant};
1+
use dal::{DalContext, Schema, SchemaVariant};
22
use dal_test::test;
33

44
use dal::schema::variant::SchemaVariantMetadataView;
@@ -21,3 +21,37 @@ async fn list_schema_variant_definition_views(ctx: &DalContext) {
2121
views.len() // actual
2222
)
2323
}
24+
25+
#[test]
26+
async fn get_schema_variant(ctx: &DalContext) {
27+
let maybe_swifty_schema = Schema::find_by_name(ctx, "swifty")
28+
.await
29+
.expect("unable to get schema");
30+
31+
assert!(maybe_swifty_schema.is_some());
32+
33+
let swifty_schema = maybe_swifty_schema.unwrap();
34+
let maybe_sv_id = swifty_schema
35+
.get_default_schema_variant(ctx)
36+
.await
37+
.expect("unable to get schema variant");
38+
39+
assert!(maybe_sv_id.is_some());
40+
41+
let sv_id = maybe_sv_id.unwrap();
42+
let sv_funcs = SchemaVariant::all_funcs(ctx, sv_id)
43+
.await
44+
.expect("Unable to get all schema variant funcs");
45+
46+
assert_eq!(4, sv_funcs.len());
47+
48+
let mut func_names: Vec<String> = sv_funcs.iter().map(|f| f.name.clone()).collect();
49+
func_names.sort();
50+
let expected: Vec<String> = vec![
51+
"si:resourcePayloadToValue".to_string(),
52+
"test:createActionSwifty".to_string(),
53+
"test:generateCode".to_string(),
54+
"test:refreshActionSwifty".to_string(),
55+
];
56+
assert_eq!(expected, func_names);
57+
}

0 commit comments

Comments
 (0)