Skip to content

Commit b43d24c

Browse files
chore: fix test
1 parent 8f1d361 commit b43d24c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

apps/workspace-engine/pkg/workspace/jobdispatch/github_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,18 @@ func TestGithubDispatcher_GetGithubEntity(t *testing.T) {
424424

425425
dispatcher := NewGithubDispatcher(mockStore)
426426
result, exists := dispatcher.store.GithubEntities.Get(tt.searchCfg.Owner, tt.searchCfg.InstallationId)
427-
if !exists {
428-
t.Errorf("Expected to find entity, got nil")
427+
428+
if tt.expectFound {
429+
if !exists {
430+
t.Fatalf("Expected to find entity, but it was not found")
431+
}
432+
require.Equal(t, tt.searchCfg.InstallationId, result.InstallationId)
433+
require.Equal(t, tt.searchCfg.Owner, result.Slug)
434+
} else {
435+
if exists {
436+
t.Fatalf("Expected entity not to be found, but found: %+v", result)
437+
}
429438
}
430-
require.Equal(t, tt.searchCfg.InstallationId, result.InstallationId)
431-
require.Equal(t, tt.searchCfg.Owner, result.Slug)
432439
})
433440
}
434441
}

0 commit comments

Comments
 (0)