use dioxus::prelude::*;
#[test]
fn partially_formatted_conditional_attribute() {
let width = "1px";
_ = rsx! {
div {
width: if true { "{width}" } else { "100px" }
}
};
let opt = "button";
_ = rsx! {
input {
type: if true { opt } else { "text" },
}
input {
type: if true { opt.to_string() } else { "text with" },
}
input {
type: if true { opt.to_string() } else { "text with {width}" },
}
input {
type: if true { opt.to_string() } else if true { "" } else { "text with {width}" },
}
input {
type: if true { "one" } else if true { "two" } else { "three" },
}
input {
type: if true { "one" } else if true { "two" } else if true { "three" } else { opt },
}
input {
type: if true { "one" } else if true { if false { "true" } else { "false" } } else { "three" },
}
input {
type: if true { "one".to_string() },
}
input {
type: if true { "one" },
}
};
}