Add unit tests for dashboard repository and enhance BSON handling
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -101,7 +101,7 @@ func TestResolveScrapedTendersScopeUsesMinIOFolders(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveScrapedTendersScopeZeroWhenMinIOEmpty(t *testing.T) {
|
||||
func TestResolveScrapedTendersScopeMongoFallbackWhenMinIOEmpty(t *testing.T) {
|
||||
repo := &repository{
|
||||
procedureLister: &mockProcedureDocumentsLister{},
|
||||
}
|
||||
@@ -110,8 +110,11 @@ func TestResolveScrapedTendersScopeZeroWhenMinIOEmpty(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if !scope.zero {
|
||||
t.Fatalf("expected zero scope, got %#v", scope)
|
||||
if scope.zero {
|
||||
t.Fatal("expected mongo fallback scope, not zero scope")
|
||||
}
|
||||
if scope.match["processing_metadata.documents_scraped"] != true {
|
||||
t.Fatalf("expected mongo fallback filter, got %#v", scope.match)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user