Added an optional founder reference to the Organization node in the Infrastructure package.
This commit is contained in:
@@ -46,6 +46,31 @@ struct StructuredDataTests {
|
||||
))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `references the organization's founder by identifier`() {
|
||||
let data = StructuredData(
|
||||
name: "A Site",
|
||||
url: "https://site.example/",
|
||||
profiles: ["https://social.example/a-site"],
|
||||
founder: "https://site.example/who#person"
|
||||
)
|
||||
|
||||
// Last of the organization's properties, after the profiles.
|
||||
#expect(data.payload.contains(
|
||||
#""sameAs":["https://social.example/a-site"],"founder":{"@id":"https://site.example/who#person"}}"#
|
||||
))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `omits the founder when the data carries none`() {
|
||||
let data = StructuredData(
|
||||
name: "A Site",
|
||||
url: "https://site.example/"
|
||||
)
|
||||
|
||||
#expect(!data.payload.contains("founder"))
|
||||
}
|
||||
|
||||
@Test
|
||||
func `derives the organization's identifier from the site URL`() {
|
||||
let url = "https://site.example/"
|
||||
|
||||
Reference in New Issue
Block a user