2026-06-28 05:07:19 +00:00
|
|
|
import Elementary
|
2026-06-29 23:08:36 +00:00
|
|
|
import Foundation
|
2026-06-28 05:07:19 +00:00
|
|
|
import Testing
|
|
|
|
|
|
2026-07-11 09:41:21 +00:00
|
|
|
@testable import WebsiteLibrary
|
2026-06-28 05:07:19 +00:00
|
|
|
|
|
|
|
|
@Suite("IndexPage page")
|
|
|
|
|
struct IndexPageTests {
|
|
|
|
|
|
|
|
|
|
// MARK: Functional tests
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
func `renders its markup`() {
|
2026-06-29 23:08:36 +00:00
|
|
|
let html = IndexPage(
|
|
|
|
|
locale: .init(identifier: "en")
|
|
|
|
|
).render()
|
2026-06-28 05:07:19 +00:00
|
|
|
|
|
|
|
|
#expect(html.contains("<!DOCTYPE html>"))
|
2026-06-29 23:08:36 +00:00
|
|
|
#expect(html.contains(#"lang="en""#))
|
2026-06-28 14:18:04 +00:00
|
|
|
#expect(html.contains("/css/style.css"))
|
|
|
|
|
#expect(html.contains("/favicon.ico"))
|
|
|
|
|
#expect(html.contains("/icon.svg"))
|
|
|
|
|
#expect(html.contains("/icon.png"))
|
|
|
|
|
#expect(html.contains("/site.webmanifest"))
|
2026-06-28 05:07:19 +00:00
|
|
|
#expect(html.contains("Hello world!"))
|
2026-06-28 14:18:04 +00:00
|
|
|
#expect(html.contains("/js/app.js"))
|
2026-06-28 05:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|