diff --git a/sitemap_index_test.go b/sitemap_index_test.go index 9993325..8214c04 100644 --- a/sitemap_index_test.go +++ b/sitemap_index_test.go @@ -644,8 +644,14 @@ func TestHreflangAlternates(t *testing.T) { t.Fatal(err) } mod := time.Date(2026, 10, 1, 8, 0, 0, 0, time.UTC) + // G3: a Journal-shaped record (P33-64): every enabled locale in sort + // order, the untranslated de with URL "" and the default locale's + // title, description and word count. + words := 120 contentStore.put(pageType, fakeRecord{ID: 1, Published: true, LastMod: mod, Locales: []pact.ContentLocale{ - {Locale: "en", URL: "/en/pages/a"}, {Locale: "pl", URL: "/strony/a"}, {Locale: "de", URL: ""}, + {Locale: "pl", URL: "/strony/a", Title: "Strona A", Description: "O stronie", Words: &words}, + {Locale: "en", URL: "/en/pages/a", Title: "Page A", Description: "About the page", Words: &words}, + {Locale: "de", URL: "", Title: "Strona A", Description: "O stronie", Words: &words}, }}) contentStore.put(pageType, fakeRecord{ID: 2, Published: true, LastMod: mod, Locales: []pact.ContentLocale{{Locale: "pl", URL: "/strony/b"}}}) e.rebuild(t) @@ -653,8 +659,8 @@ func TestHreflangAlternates(t *testing.T) { if !strings.Contains(body, ``) { t.Fatalf("the xhtml namespace is not declared:\n%s", body) } - alts := `` + - `` + + alts := `` + + `` + `` for _, loc := range []string{"https://api.example.test/en/pages/a", "https://api.example.test/strony/a"} { if !strings.Contains(body, ""+loc+"2026-10-01T08:00:00Z"+alts+"") {