You've already forked caddy-opnsense-blocker
Add review filter and promote decisions panel
This commit is contained in:
@@ -83,6 +83,9 @@ func TestHandlerServesOverviewAndManualActions(t *testing.T) {
|
||||
if !strings.Contains(recorder.Body.String(), "Show allowed") {
|
||||
t.Fatalf("overview page should expose the allowed toggle")
|
||||
}
|
||||
if !strings.Contains(recorder.Body.String(), "Review only") {
|
||||
t.Fatalf("overview page should expose the review-only toggle")
|
||||
}
|
||||
if !strings.Contains(recorder.Body.String(), "localStorage") {
|
||||
t.Fatalf("overview page should persist preferences in localStorage")
|
||||
}
|
||||
@@ -103,6 +106,15 @@ func TestHandlerServesOverviewAndManualActions(t *testing.T) {
|
||||
if strings.Contains(body, `refresh().then(() => investigate());`) {
|
||||
t.Fatalf("ip details page should not auto-refresh investigation on load")
|
||||
}
|
||||
investigationIndex := strings.Index(body, "<h2>Investigation</h2>")
|
||||
decisionsIndex := strings.Index(body, "<h2>Decisions</h2>")
|
||||
requestsIndex := strings.Index(body, "<h2>Requests from this IP</h2>")
|
||||
if investigationIndex == -1 || decisionsIndex == -1 || requestsIndex == -1 {
|
||||
t.Fatalf("ip details page is missing expected sections")
|
||||
}
|
||||
if !(investigationIndex < decisionsIndex && decisionsIndex < requestsIndex) {
|
||||
t.Fatalf("expected Decisions block right after Investigation block")
|
||||
}
|
||||
}
|
||||
|
||||
type stubApp struct {
|
||||
|
||||
Reference in New Issue
Block a user