Skip to content

Commit

Permalink
modificate test for record zero TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
nobleess committed Jan 17, 2025
1 parent f8ce333 commit a5654b4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/mikrotik/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,25 @@ func TestChanges(t *testing.T) {
},
},
},
{
name: "Create record with zero value in TTL",
provider: mikrotikProvider,
inputChanges: &plan.Changes{
Create: []*endpoint.Endpoint{
{
DNSName: "example.org",
Targets: endpoint.NewTargets("2.2.2.2"),
RecordTTL: endpoint.TTL(0),
ProviderSpecific: endpoint.ProviderSpecific{
{Name: "comment", Value: "another comment"},
{Name: "address-list", Value: "secondary"},
{Name: "match-subdomain", Value: "*.example.com"},
},
},
},
},
expectedChanges: &plan.Changes{},
},
}

for _, tt := range tests {
Expand All @@ -552,6 +571,11 @@ func TestChanges(t *testing.T) {
t.Errorf("Expected endpoint: %v , got %v", tt.expectedChanges.UpdateNew[i], outputChanges.UpdateNew[i])
}
}
for i := range outputChanges.Create {
if outputChanges.Create[i].RecordTTL != 0 {
t.Errorf("Expected Create endpoint TTL %d, got %d", 0, outputChanges.Create[i].RecordTTL)
}
}
})
}
}

0 comments on commit a5654b4

Please sign in to comment.