|
@@ -74,12 +74,9 @@ fn href_internal() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default}>Link</a>",
|
|
|
href = r#"href="/test""#,
|
|
|
default = r#"dioxus-prevent-default="onclick""#,
|
|
|
- class = r#"class="""#,
|
|
|
- rel = r#"rel="""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|
|
@@ -111,12 +108,10 @@ fn href_external() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {rel}>Link</a>",
|
|
|
href = r#"href="https://dioxuslabs.com/""#,
|
|
|
default = r#"dioxus-prevent-default="""#,
|
|
|
- class = r#"class="""#,
|
|
|
rel = r#"rel="noopener noreferrer""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|
|
@@ -149,12 +144,10 @@ fn with_class() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {class}>Link</a>",
|
|
|
href = r#"href="/test""#,
|
|
|
default = r#"dioxus-prevent-default="onclick""#,
|
|
|
class = r#"class="test_class""#,
|
|
|
- rel = r#"rel="""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|
|
@@ -181,12 +174,10 @@ fn with_active_class_active() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {class}>Link</a>",
|
|
|
href = r#"href="/""#,
|
|
|
default = r#"dioxus-prevent-default="onclick""#,
|
|
|
class = r#"class="test_class active_class""#,
|
|
|
- rel = r#"rel="""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|
|
@@ -220,12 +211,10 @@ fn with_active_class_inactive() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {class}>Link</a>",
|
|
|
href = r#"href="/test""#,
|
|
|
default = r#"dioxus-prevent-default="onclick""#,
|
|
|
class = r#"class="test_class""#,
|
|
|
- rel = r#"rel="""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|
|
@@ -258,13 +247,10 @@ fn with_id() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target} {id}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {id}>Link</a>",
|
|
|
href = r#"href="/test""#,
|
|
|
default = r#"dioxus-prevent-default="onclick""#,
|
|
|
- class = r#"class="""#,
|
|
|
id = r#"id="test_id""#,
|
|
|
- rel = r#"rel="""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|
|
@@ -297,11 +283,9 @@ fn with_new_tab() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {target}>Link</a>",
|
|
|
href = r#"href="/test""#,
|
|
|
default = r#"dioxus-prevent-default="""#,
|
|
|
- class = r#"class="""#,
|
|
|
- rel = r#"rel="""#,
|
|
|
target = r#"target="_blank""#
|
|
|
);
|
|
|
|
|
@@ -328,10 +312,9 @@ fn with_new_tab_external() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {rel} {target}>Link</a>",
|
|
|
href = r#"href="https://dioxuslabs.com/""#,
|
|
|
default = r#"dioxus-prevent-default="""#,
|
|
|
- class = r#"class="""#,
|
|
|
rel = r#"rel="noopener noreferrer""#,
|
|
|
target = r#"target="_blank""#
|
|
|
);
|
|
@@ -366,12 +349,10 @@ fn with_rel() {
|
|
|
}
|
|
|
|
|
|
let expected = format!(
|
|
|
- "<h1>App</h1><a {href} {default} {class} {rel} {target}>Link</a>",
|
|
|
+ "<h1>App</h1><a {href} {default} {rel}>Link</a>",
|
|
|
href = r#"href="/test""#,
|
|
|
default = r#"dioxus-prevent-default="onclick""#,
|
|
|
- class = r#"class="""#,
|
|
|
rel = r#"rel="test_rel""#,
|
|
|
- target = r#"target="""#
|
|
|
);
|
|
|
|
|
|
assert_eq!(prepare::<Route>(), expected);
|