Skip to content

Commit

Permalink
fix: si_frontend_types conversions on tests
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Bustamante <[email protected]>
  • Loading branch information
vbustamante committed Aug 14, 2024
1 parent 68651f5 commit 29788c2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
3 changes: 2 additions & 1 deletion lib/dal/tests/integration_test/component/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ async fn auto_upgrade_component(ctx: &mut DalContext) {
.components
.first()
.expect("unable to get the upgradable component on the graph");
assert_eq!(my_upgraded_component.schema_variant_id.into(), variant_one);

assert_eq!(my_upgraded_component.schema_variant_id, variant_one.into());

let view_after_upgrade = Component::get_by_id(ctx, my_upgraded_component.component_id.into())
.await
Expand Down
7 changes: 4 additions & 3 deletions lib/dal/tests/integration_test/diagram.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use dal::{change_status::ChangeStatus, diagram::Diagram, Component, DalContext};
use dal::{diagram::Diagram, Component, DalContext};
use dal_test::{
helpers::{create_component_for_default_schema_name, ChangeSetTestHelpers},
test,
Expand Down Expand Up @@ -50,8 +50,9 @@ async fn components_removed_from_snapshot_have_virtual_diagram_entries(ctx: &mut
.find(|comp| comp.id == component_to_remove.id().into())
.expect("Removed Component not found in summary diagram");
assert!(removed_component_summary.from_base_change_set);

assert_eq!(
ChangeStatus::Deleted,
removed_component_summary.change_status.into()
si_frontend_types::ChangeStatus::Deleted,
removed_component_summary.change_status
);
}
43 changes: 21 additions & 22 deletions lib/dal/tests/integration_test/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,9 @@ async fn convert_component_to_frame_and_attach_no_nesting(ctx: &mut DalContext)
assert!(starfield_parent_node_id.is_none());
assert_eq!(
starfield_component.id(),
<std::option::Option<si_events::ComponentId> as std::convert::Into<T>>::into(
fallout_parent_node_id
)
.into()
.expect("no parent node id for fallout component")
fallout_parent_node_id
.expect("fallout should have a parent node")
.into()
);
}

Expand Down Expand Up @@ -1964,10 +1962,11 @@ async fn multiple_frames_with_complex_connections_no_nesting(ctx: &mut DalContex
assert!(new_era_taylor_swift_assembled.0.parent_id.is_none());
assert_eq!(
new_era_taylor_swift.id(), // expected
<std::option::Option<si_events::ComponentId> as std::convert::Into<T>>::into(
travis_kelce_assembled.0.parent_id
)
.expect("no parent node id") // actual
travis_kelce_assembled
.0
.parent_id
.expect("no parent node id")
.into() // actual
);
}

Expand Down Expand Up @@ -2025,8 +2024,8 @@ async fn multiple_frames_with_complex_connections_no_nesting(ctx: &mut DalContex
travis_kelce_assembled
.0
.parent_id
.into()
.expect("no parent node id") // actual
.expect("no parent node id")
.into() // actual
);
}

Expand Down Expand Up @@ -2095,16 +2094,16 @@ async fn multiple_frames_with_complex_connections_no_nesting(ctx: &mut DalContex
travis_kelce_assembled
.0
.parent_id
.into()
.expect("no parent node id") // actual
.expect("no parent node id")
.into() // actual
);
assert_eq!(
country_era_taylor_swift.id(), // expected
mama_kelce_assembled
.0
.parent_id
.into()
.expect("no parent node id") // actual
.expect("no parent node id")
.into() // actual
);
}

Expand Down Expand Up @@ -2170,24 +2169,24 @@ async fn multiple_frames_with_complex_connections_no_nesting(ctx: &mut DalContex
country_era_taylor_swift_assembled
.0
.parent_id
.into()
.expect("no parent node id")
.into()
);
assert_eq!(
new_era_taylor_swift.id(), // expected
travis_kelce_assembled
.0
.parent_id
.expect("no parent node id") // actual
.into()
.expect("no parent node id") // actual
);
assert_eq!(
country_era_taylor_swift.id(), // expected
mama_kelce_assembled
.0
.parent_id
.expect("no parent node id") // actual
.into()
.expect("no parent node id") // actual
);
}
//Scenario 7?! No more Country Era Swift, she wants to break freeeeeee
Expand Down Expand Up @@ -2249,16 +2248,16 @@ async fn multiple_frames_with_complex_connections_no_nesting(ctx: &mut DalContex
travis_kelce_assembled
.0
.parent_id
.into()
.expect("no parent node id") // actual
.expect("no parent node id")
.into() // actual
);
assert_eq!(
country_era_taylor_swift.id(), // expected
country_era_taylor_swift.id(), // expectedº
mama_kelce_assembled
.0
.parent_id
.expect("no parent node id")
.into()
.expect("no parent node id") // actual
);
}
}
Expand Down

0 comments on commit 29788c2

Please sign in to comment.