-
Notifications
You must be signed in to change notification settings - Fork 330
Rename domainStatus → classifyFirewallDomainStatus and statusEmoji → firewallStatusEmoji
#24712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,7 +243,7 @@ func TestDomainStatus(t *testing.T) { | |
|
|
||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| result := domainStatus(tt.stats) | ||
| result := classifyFirewallDomainStatus(tt.stats) | ||
|
Comment on lines
244
to
+246
|
||
| assert.Equal(t, tt.expected, result, "Domain status should match") | ||
| }) | ||
| } | ||
|
|
@@ -297,11 +297,11 @@ func TestFirewallDiffJSONSerialization(t *testing.T) { | |
| } | ||
|
|
||
| func TestStatusEmoji(t *testing.T) { | ||
| assert.Equal(t, "✅", statusEmoji("allowed"), "Allowed should show checkmark") | ||
| assert.Equal(t, "❌", statusEmoji("denied"), "Denied should show X") | ||
| assert.Equal(t, "⚠️", statusEmoji("mixed"), "Mixed should show warning") | ||
| assert.Equal(t, "❓", statusEmoji("unknown"), "Unknown should show question mark") | ||
| assert.Equal(t, "❓", statusEmoji(""), "Empty should show question mark") | ||
| assert.Equal(t, "✅", firewallStatusEmoji("allowed"), "Allowed should show checkmark") | ||
| assert.Equal(t, "❌", firewallStatusEmoji("denied"), "Denied should show X") | ||
| assert.Equal(t, "⚠️", firewallStatusEmoji("mixed"), "Mixed should show warning") | ||
| assert.Equal(t, "❓", firewallStatusEmoji("unknown"), "Unknown should show question mark") | ||
| assert.Equal(t, "❓", firewallStatusEmoji(""), "Empty should show question mark") | ||
| } | ||
|
|
||
| func TestIsEmptyDiff(t *testing.T) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc comment says this returns only "allowed", "denied", or "mixed", but the implementation can also return "unknown" (e.g., when Allowed==0 && Blocked==0). Please update the comment to include "unknown" so it matches actual behavior.