fix more errors in core tests

This commit is contained in:
Evan Almloff committed 2024-01-11 12:40:36 -06:00
1 parent 8d783490a0
commit a9d09d858b
20 files changed
+84 -155

No files matched your search

+7 -3
View File
@@ -4,7 +4,7 @@ use dioxus::prelude::*;
#[test]
fn state_shares() {
fn app() -> Element {
cx.provide_context(generation().unwrap() as i32);
cx.provide_context(generation() as i32);
render!(child_1 {})
}
@@ -29,11 +29,15 @@ fn state_shares() {
dom.mark_dirty(ScopeId::ROOT);
_ = dom.render_immediate_to_vec();
assert_eq!(dom.base_scope().consume_context::<i32>().unwrap(), 1);
dom.in_runtime(|| {
assert_eq!(ScopeId::ROOT.consume_context::<i32>().unwrap(), 1);
});
dom.mark_dirty(ScopeId::ROOT);
_ = dom.render_immediate_to_vec();
assert_eq!(dom.base_scope().consume_context::<i32>().unwrap(), 2);
dom.in_runtime(|| {
assert_eq!(ScopeId::ROOT.consume_context::<i32>().unwrap(), 2);
});
dom.mark_dirty(ScopeId(2));
assert_eq!(