wip: basic creates working properly

This commit is contained in:
Jonathan Kelley committed 2021-08-21 23:04:34 -04:00
1 parent 24572b63de
commit 1622f484b3
4 files changed
+237 -149

No files matched your search

+45 -10
View File
@@ -60,7 +60,7 @@ async fn test_iterative_create() {
async fn test_iterative_create_list() {
static App: FC<()> = |cx| {
cx.render(rsx! {
{(0..10).map(|f| rsx!{ div {
{(0..3).map(|f| rsx!{ div {
"hello"
}})}
})
@@ -73,12 +73,47 @@ async fn test_iterative_create_list() {
dbg!(mutations);
}
// #[async_std::test]
// async fn websys_loop() {
// ///loop {
// /// let deadline = request_idle_callback().await;
// /// let edits = dom.work(deadline);
// /// request_animation_frame().await;
// /// apply(edits);
// ///}
// }
#[async_std::test]
async fn test_iterative_create_simple() {
static App: FC<()> = |cx| {
cx.render(rsx! {
div {}
div {}
div {}
div {}
})
};
test_logging::set_up_logging();
let mut dom = VirtualDom::new(App);
let mutations = dom.rebuild_async().await.unwrap();
dbg!(mutations);
}
#[async_std::test]
async fn test_iterative_create_components() {
static App: FC<()> = |cx| {
cx.render(rsx! {
Child { "abc1" }
Child { "abc2" }
Child { "abc3" }
})
};
static Child: FC<()> = |cx| {
cx.render(rsx! {
h1 {}
div {
{cx.children()}
}
p {}
})
};
test_logging::set_up_logging();
let mut dom = VirtualDom::new(App);
let mutations = dom.rebuild_async().await.unwrap();
dbg!(mutations);
}
-2
View File
@@ -44,6 +44,4 @@ pub fn set_up_logging() {
.chain(std::io::stdout())
.apply()
.unwrap();
debug!("finished setting up logging! yay!");
}