Updated the event tagging for the AnalyticsEvent+Tagging extension in the Infrastructure package to support attribute-capable tags.
This commit is contained in:
+10
@@ -46,4 +46,14 @@ struct AnalyticsEventTaggingTests {
|
||||
#expect(attributes.count == event.attributes.count)
|
||||
}
|
||||
|
||||
@Test
|
||||
func `applies the event name to an SVG tag`() {
|
||||
// `SVGTag.path` is no `HTMLTrait.Attributes.Global`, so this stops compiling if the method narrows back to HTML tags.
|
||||
let rendered = SVG.path {}
|
||||
.attributes(contentsOf: Analytics.Event(name: "logo").tagging())
|
||||
.render()
|
||||
|
||||
#expect(rendered.contains(#"data-umami-event="logo""#))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user