46 lines
2.2 KiB
Rust
46 lines
2.2 KiB
Rust
|
use crate::js;
|
||
|
|
||
|
// ██████╗ █████╗ ███████╗███████╗██╗███╗ ██╗ ██████╗
|
||
|
// ██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗ ██║██╔════╝
|
||
|
// ██████╔╝███████║███████╗███████╗██║██╔██╗ ██║██║ ███╗
|
||
|
// ██╔═══╝ ██╔══██║╚════██║╚════██║██║██║╚██╗██║██║ ██║
|
||
|
// ██║ ██║ ██║███████║███████║██║██║ ╚████║╚██████╔╝
|
||
|
// ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝
|
||
|
|
||
|
#[test]
|
||
|
fn passing_onblur_camelcase() {
|
||
|
assert!(js::attr_is_event_handler("onBlur"));
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn passing_onclick_lowercase() {
|
||
|
assert!(js::attr_is_event_handler("onclick"));
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn passing_onclick_camelcase() {
|
||
|
assert!(js::attr_is_event_handler("onClick"));
|
||
|
}
|
||
|
|
||
|
// ███████╗ █████╗ ██╗██╗ ██╗███╗ ██╗ ██████╗
|
||
|
// ██╔════╝██╔══██╗██║██║ ██║████╗ ██║██╔════╝
|
||
|
// █████╗ ███████║██║██║ ██║██╔██╗ ██║██║ ███╗
|
||
|
// ██╔══╝ ██╔══██║██║██║ ██║██║╚██╗██║██║ ██║
|
||
|
// ██║ ██║ ██║██║███████╗██║██║ ╚████║╚██████╔╝
|
||
|
// ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝
|
||
|
|
||
|
#[test]
|
||
|
fn failing_href() {
|
||
|
assert!(!js::attr_is_event_handler("href"));
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn failing_empty_string() {
|
||
|
assert!(!js::attr_is_event_handler(""));
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn failing_class() {
|
||
|
assert!(!js::attr_is_event_handler("class"));
|
||
|
}
|