altera soa-edit-api para INCEPTION-INCREMENT

This commit is contained in:
2026-09-15 10:12:17 -03:00
parent 2408be5e25
commit 653744867c
4 changed files with 41 additions and 9 deletions
+28
View File
@@ -151,6 +151,34 @@ func TestAuthCanBeDisabled(t *testing.T) {
}
}
func TestZoneRecordsPageShowsSOAEditAPI(t *testing.T) {
client := &fakeClient{zone: pdns.Zone{
Name: "example.org.",
SOAEditAPI: "INCEPTION-INCREMENT",
RRSets: []pdns.RRSet{{
Name: "example.org.",
Type: "SOA",
TTL: 3600,
}},
}}
srv, err := New(Config{}, client, nil)
if err != nil {
t.Fatalf("New returned error: %v", err)
}
req := httptest.NewRequest(http.MethodGet, "/zones/example.org.", nil)
rec := httptest.NewRecorder()
srv.routes().ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("unexpected status: %d", rec.Code)
}
body := rec.Body.String()
if !strings.Contains(body, "SOA-EDIT-API:") || !strings.Contains(body, "INCEPTION-INCREMENT") {
t.Fatalf("expected SOA-EDIT-API value in zone records page, got %q", body)
}
}
func TestServesEmbeddedTablerAssets(t *testing.T) {
srv, err := New(Config{}, &fakeClient{}, nil)
if err != nil {