Added the organization identifier helper to the StructuredData type in the Infrastructure package target.
This commit is contained in:
@@ -46,6 +46,19 @@ struct StructuredDataTests {
|
||||
))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `derives the organization's identifier from the site URL`() {
|
||||
let url = "https://site.example/"
|
||||
let data = StructuredData(
|
||||
name: "A Site",
|
||||
url: url
|
||||
)
|
||||
|
||||
// The helper is what another page references the organization by, so it has to name the node this actually builds.
|
||||
#expect(StructuredData.organizationID(forSiteURL: url) == "https://site.example/#organization")
|
||||
#expect(data.payload.contains(##""@id":"\##(StructuredData.organizationID(forSiteURL: url))""##))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `omits the properties of the facts minimal data does not carry`() {
|
||||
let data = StructuredData(
|
||||
|
||||
Reference in New Issue
Block a user