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
|
|
|
|
2026-07-30 06:33:57 +00:00
|
|
|
@Suite(
|
2026-08-01 23:06:22 +02:00
|
|
|
"NotFoundPage page",
|
2026-07-30 06:33:57 +00:00
|
|
|
.tags(.page)
|
|
|
|
|
)
|
2026-08-01 23:06:22 +02:00
|
|
|
struct NotFoundPageTests {
|
2026-06-28 05:07:19 +00:00
|
|
|
|
|
|
|
|
// MARK: Functional tests
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
func `renders its markup`() {
|
2026-08-01 23:06:22 +02:00
|
|
|
let html = NotFoundPage(
|
2026-06-29 23:08:36 +00:00
|
|
|
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 05:07:19 +00:00
|
|
|
#expect(html.contains("Page Not Found"))
|
2026-06-29 23:08:36 +00:00
|
|
|
#expect(html.contains("Sorry, but the page you were trying to view does not exist."))
|
2026-07-19 02:08:59 +00:00
|
|
|
#expect(html.contains("/css/shared.css"))
|
2026-08-01 23:07:04 +02:00
|
|
|
#expect(html.contains("/css/not-found.css"))
|
|
|
|
|
#expect(html.contains("/js/not-found.js"))
|
2026-07-19 02:08:59 +00:00
|
|
|
#expect(html.contains("/js/shared.js"))
|
2026-06-28 05:07:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|