Skip to content

Commit 60a9f51

Browse files
committed
add scan assertions
Signed-off-by: freedisch <freeproduc@gmail.com>
1 parent 8bcf3d5 commit 60a9f51

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

scbctl/cmd/scans_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package cmd
55

66
import (
7+
"context"
78
"errors"
89
"testing"
910

@@ -88,6 +89,16 @@ func TestScanCommand(t *testing.T) {
8889
t.Errorf("expected no error, but got: %v", err)
8990
}
9091

92+
if tc.expectedError == nil {
93+
scans := &v1.ScanList{}
94+
if listErr := client.List(context.Background(), scans); listErr != nil {
95+
t.Fatalf("failed to list scans: %v", listErr)
96+
}
97+
if len(scans.Items) != 1 {
98+
t.Fatalf("expected 1 scan to created but got %d", len(scans.Items))
99+
}
100+
}
101+
91102
})
92103
}
93104
}

0 commit comments

Comments
 (0)