Project updates from Template #1
@@ -7,8 +7,6 @@ import Infrastructure
|
|||||||
enum StaticFile: Asset, CaseIterable {
|
enum StaticFile: Asset, CaseIterable {
|
||||||
/// The `apple-touch-icon.png` icon.
|
/// The `apple-touch-icon.png` icon.
|
||||||
case appleTouchIcon
|
case appleTouchIcon
|
||||||
/// The `css/error.css` stylesheet and `js/error.js` script for the not-found page.
|
|
||||||
case error
|
|
||||||
/// The `favicon.ico` icon.
|
/// The `favicon.ico` icon.
|
||||||
case favicon
|
case favicon
|
||||||
/// The `icon.svg` icon.
|
/// The `icon.svg` icon.
|
||||||
@@ -19,6 +17,8 @@ enum StaticFile: Asset, CaseIterable {
|
|||||||
case icon512
|
case icon512
|
||||||
/// The `css/index.css` stylesheet and `js/index.js` script for the landing page.
|
/// The `css/index.css` stylesheet and `js/index.js` script for the landing page.
|
||||||
case index
|
case index
|
||||||
|
/// The `css/not-found.css` stylesheet and `js/not-found.js` script for the not-found page.
|
||||||
|
case notFound
|
||||||
/// The `robots.txt` crawler directives.
|
/// The `robots.txt` crawler directives.
|
||||||
case robots
|
case robots
|
||||||
/// The `css/shared.css` stylesheet and `js/shared.js` script shared across pages.
|
/// The `css/shared.css` stylesheet and `js/shared.js` script shared across pages.
|
||||||
@@ -41,8 +41,8 @@ extension StaticFile {
|
|||||||
case .appleTouchIcon,
|
case .appleTouchIcon,
|
||||||
.icon192,
|
.icon192,
|
||||||
.icon512: [.png]
|
.icon512: [.png]
|
||||||
case .error,
|
case .index,
|
||||||
.index,
|
.notFound,
|
||||||
.shared: [.css, .js]
|
.shared: [.css, .js]
|
||||||
case .favicon: [.ico]
|
case .favicon: [.ico]
|
||||||
case .icon: [.svg]
|
case .icon: [.svg]
|
||||||
@@ -56,12 +56,12 @@ extension StaticFile {
|
|||||||
var fileName: String {
|
var fileName: String {
|
||||||
switch self {
|
switch self {
|
||||||
case .appleTouchIcon: "apple-touch-icon"
|
case .appleTouchIcon: "apple-touch-icon"
|
||||||
case .error: "error"
|
|
||||||
case .favicon: "favicon"
|
case .favicon: "favicon"
|
||||||
case .icon: "icon"
|
case .icon: "icon"
|
||||||
case .icon192: "icon-192"
|
case .icon192: "icon-192"
|
||||||
case .icon512: "icon-512"
|
case .icon512: "icon-512"
|
||||||
case .index: "index"
|
case .index: "index"
|
||||||
|
case .notFound: "not-found"
|
||||||
case .robots: "robots"
|
case .robots: "robots"
|
||||||
case .shared: "shared"
|
case .shared: "shared"
|
||||||
case .site: "site"
|
case .site: "site"
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ struct AppTests {
|
|||||||
) { response in
|
) { response in
|
||||||
let body = String(buffer: response.body)
|
let body = String(buffer: response.body)
|
||||||
|
|
||||||
#expect(body.contains("/css/error.css?v="))
|
#expect(body.contains("/css/not-found.css?v="))
|
||||||
#expect(body.contains("/js/shared.js?v="))
|
#expect(body.contains("/js/shared.js?v="))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,12 +54,12 @@ private extension StaticFileTests {
|
|||||||
|
|
||||||
static let fileExtensions: [[AssetExtension]] = [
|
static let fileExtensions: [[AssetExtension]] = [
|
||||||
[.png],
|
[.png],
|
||||||
[.css, .js],
|
|
||||||
[.ico],
|
[.ico],
|
||||||
[.svg],
|
[.svg],
|
||||||
[.png],
|
[.png],
|
||||||
[.png],
|
[.png],
|
||||||
[.css, .js],
|
[.css, .js],
|
||||||
|
[.css, .js],
|
||||||
[.txt],
|
[.txt],
|
||||||
[.css, .js],
|
[.css, .js],
|
||||||
[.webmanifest],
|
[.webmanifest],
|
||||||
@@ -67,12 +67,12 @@ private extension StaticFileTests {
|
|||||||
]
|
]
|
||||||
static let fileNames: [String] = [
|
static let fileNames: [String] = [
|
||||||
"apple-touch-icon",
|
"apple-touch-icon",
|
||||||
"error",
|
|
||||||
"favicon",
|
"favicon",
|
||||||
"icon",
|
"icon",
|
||||||
"icon-192",
|
"icon-192",
|
||||||
"icon-512",
|
"icon-512",
|
||||||
"index",
|
"index",
|
||||||
|
"not-found",
|
||||||
"robots",
|
"robots",
|
||||||
"shared",
|
"shared",
|
||||||
"site",
|
"site",
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ struct NotFoundPageTests {
|
|||||||
#expect(html.contains("Page Not Found"))
|
#expect(html.contains("Page Not Found"))
|
||||||
#expect(html.contains("Sorry, but the page you were trying to view does not exist."))
|
#expect(html.contains("Sorry, but the page you were trying to view does not exist."))
|
||||||
#expect(html.contains("/css/shared.css"))
|
#expect(html.contains("/css/shared.css"))
|
||||||
#expect(html.contains("/css/error.css"))
|
#expect(html.contains("/css/not-found.css"))
|
||||||
#expect(html.contains("/js/error.js"))
|
#expect(html.contains("/js/not-found.js"))
|
||||||
#expect(html.contains("/js/shared.js"))
|
#expect(html.contains("/js/shared.js"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user