Skip to content

Commit

Permalink
dns: add test cases for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Jan 10, 2023
1 parent c4598c1 commit 5dfa991
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ func TestListDNSRecordsSearch(t *testing.T) {
assert.Equal(t, "1", r.URL.Query().Get("page"))
assert.Equal(t, "type", r.URL.Query().Get("order"))
assert.Equal(t, "asc", r.URL.Query().Get("direction"))
assert.Equal(t, "any", r.URL.Query().Get("tag-match"))
assert.ElementsMatch(t, []string{"tag1", "tag2"}, r.URL.Query()["tag"])

w.Header().Set("content-type", "application/json")
fmt.Fprint(w, `{
Expand Down Expand Up @@ -334,6 +336,8 @@ func TestListDNSRecordsSearch(t *testing.T) {
Name: "example.com",
Type: "A",
Content: "198.51.100.4",
TagMatch: "any",
Tags: []string{"tag1", "tag2"},
})
require.NoError(t, err)
assert.Equal(t, 2000, resultInfo.Total)
Expand Down

0 comments on commit 5dfa991

Please sign in to comment.