include!("generated.rs");
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_property_names() {
assert_eq!(CssProperty::Display.as_str(), "display");
assert_eq!(CssProperty::Position.as_str(), "position");
assert_eq!(CssProperty::Width.as_str(), "width");
assert_eq!(CssProperty::Height.as_str(), "height");
}
#[test]
fn test_hyphenated_properties() {
assert_eq!(CssProperty::ZIndex.as_str(), "z-index");
assert_eq!(CssProperty::FlexDirection.as_str(), "flex-direction");
assert_eq!(CssProperty::BackgroundColor.as_str(), "background-color");
}
#[test]
fn test_property_categories() {
assert_eq!(CssProperty::Display.category(), CssCategory::Layout);
assert_eq!(CssProperty::Width.category(), CssCategory::BoxModel);
assert_eq!(CssProperty::FlexDirection.category(), CssCategory::Flexbox);
assert_eq!(
CssProperty::GridTemplateColumns.category(),
CssCategory::Grid
);
assert_eq!(CssProperty::FontSize.category(), CssCategory::Typography);
assert_eq!(CssProperty::Color.category(), CssCategory::Color);
}
#[test]
fn test_shorthand_detection() {
assert!(CssProperty::Margin.is_shorthand());
assert!(CssProperty::Padding.is_shorthand());
assert!(CssProperty::Border.is_shorthand());
assert!(CssProperty::Flex.is_shorthand());
assert!(CssProperty::Background.is_shorthand());
assert!(CssProperty::Transition.is_shorthand());
assert!(CssProperty::Animation.is_shorthand());
}
#[test]
fn test_non_shorthand_properties() {
assert!(!CssProperty::Display.is_shorthand());
assert!(!CssProperty::Width.is_shorthand());
assert!(!CssProperty::FlexDirection.is_shorthand());
}
#[test]
fn test_experimental_detection() {
assert!(!CssProperty::Display.is_experimental());
assert!(!CssProperty::FlexDirection.is_experimental());
}
#[test]
fn test_mdn_url() {
let url = CssProperty::Display.mdn_url();
assert!(url.contains("developer.mozilla.org"));
assert!(url.contains("display"));
let url = CssProperty::FlexDirection.mdn_url();
assert!(url.contains("developer.mozilla.org"));
assert!(url.contains("flex-direction"));
}
}