Project updates from Template (#1)

This PR contains the latest updates from the generic Website template, which have been added while working on #loud-amsterdam.

Reviewed-on: #1
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #1.
This commit is contained in:
2026-09-04 13:40:35 +00:00
committed by javier
parent 08b4d80064
commit 65b62681eb
60 changed files with 2347 additions and 326 deletions
@@ -0,0 +1,24 @@
import Testing
@testable import WebsiteLibrary
@Suite(
"ImageWidth enumeration",
.tags(.enumeration)
)
struct ImageWidthTests {
// MARK: Computed tests
@Test(arguments: zip(
ImageWidth.allCases,
[480, 800, 1200]
))
func `width`(
for imageWidth: ImageWidth,
expects width: Int
) {
#expect(imageWidth.width == width)
}
}
@@ -1,82 +0,0 @@
import Infrastructure
import Testing
@testable import WebsiteLibrary
@Suite(
"StaticFile enumeration",
.tags(.enumeration)
)
struct StaticFileTests {
// MARK: Type aliases
typealias File = StaticFile
// MARK: Computed tests
@Test(arguments: zip(
File.allCases,
Self.fileExtensions
))
func `file extensions`(
for file: File,
expects extensions: [AssetExtension]
) {
#expect(file.fileExtensions == extensions)
}
@Test(arguments: zip(
File.allCases,
Self.fileNames
))
func `file name`(
for file: File,
expects fileName: String
) {
#expect(file.fileName == fileName)
}
// MARK: CaseIterable tests
@Test
func `all cases`() {
#expect(File.allCases.count == 11)
}
}
// MARK: - Helpers
private extension StaticFileTests {
// MARK: Constants
static let fileExtensions: [[AssetExtension]] = [
[.png],
[.ico],
[.svg],
[.png],
[.png],
[.css, .js],
[.css, .js],
[.txt],
[.css, .js],
[.webmanifest],
[.xml]
]
static let fileNames: [String] = [
"apple-touch-icon",
"favicon",
"icon",
"icon-192",
"icon-512",
"index",
"not-found",
"robots",
"shared",
"site",
"sitemap"
]
}