Added an optional founder reference to the Organization node in the Infrastructure package.

This commit is contained in:
2026-08-24 22:37:45 +02:00
parent 74e81e1517
commit 1033cab2af
4 changed files with 39 additions and 5 deletions
@@ -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/"