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,40 @@
|
||||
import Elementary
|
||||
import Testing
|
||||
|
||||
@testable import WebsiteLibrary
|
||||
|
||||
@Suite(
|
||||
"SiteFooter component",
|
||||
.tags(.component)
|
||||
)
|
||||
struct SiteFooterTests {
|
||||
|
||||
// MARK: Functional tests
|
||||
|
||||
@Test
|
||||
func `renders its link columns`() {
|
||||
let html = SiteFooter().render()
|
||||
|
||||
for title in ["Browse", "Sell", "Account", "Language"] {
|
||||
#expect(html.contains(">\(title)</h2>"))
|
||||
}
|
||||
|
||||
for path in [String.Route.series, .Route.openShop, .Route.gradingGuide, .Route.signIn, .Route.recover, .Route.terms] {
|
||||
#expect(html.contains(#"href="\#(path)""#))
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
func `escapes the ampersands in its labels`() {
|
||||
#expect(SiteFooter().render().contains("Want list & alerts"))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `presses the one language the prototype serves`() {
|
||||
let html = SiteFooter().render()
|
||||
|
||||
#expect(html.components(separatedBy: #"aria-pressed="true""#).count - 1 == 1)
|
||||
#expect(html.contains(#"aria-pressed="true">EN<"#))
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user