Implemented phase 0 for the POC prototype in the Website service.
This commit is contained in:
1 parent
916df7e2f0
commit
717df5208c
31 files changed
+2351
-240
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import Elementary
|
||||
import Testing
|
||||
|
||||
@testable import WebsiteLibrary
|
||||
|
||||
@Suite(
|
||||
"Icon component",
|
||||
.tags(.component)
|
||||
)
|
||||
struct IconTests {
|
||||
|
||||
// MARK: Functional tests
|
||||
|
||||
@Test
|
||||
func `renders a decorative icon at the given size`() {
|
||||
let html = Icon(.search, size: 16).render()
|
||||
|
||||
#expect(html.hasPrefix("<svg"))
|
||||
#expect(html.contains(#"width="16" height="16""#))
|
||||
#expect(html.contains(#"aria-hidden="true""#))
|
||||
#expect(html.contains(#"stroke="currentColor""#))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `renders no inline styles`() {
|
||||
// The Content-Security-Policy blocks `style` attributes, inside an SVG as anywhere else.
|
||||
#expect(!Icon(.key).render().contains("style="))
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user