fix plugin manifest registration upsert
This commit is contained in:
@@ -1292,8 +1292,15 @@ func TestGamePluginManifestRegistryAPI(t *testing.T) {
|
||||
t.Fatalf("unexpected plugin detail: %+v", detail)
|
||||
}
|
||||
|
||||
duplicate := performJSON(t, router, http.MethodPost, "/api/v1/game-plugins/register-manifest", registration)
|
||||
assertErrorResponse(t, duplicate, http.StatusConflict, errorCodeDuplicate)
|
||||
registration.Manifest.Version = "0.1.1"
|
||||
registration.Manifest.Description = "Development plugin refreshed"
|
||||
registration.ManifestRef = "artifact://manifests/game.example/0.1.1"
|
||||
refreshed := postJSON[dto.GamePluginResponse](t, router, "/api/v1/game-plugins/register-manifest", registration)
|
||||
if refreshed.ID != created.ID || refreshed.Version != "0.1.1" || refreshed.ManifestRef != "artifact://manifests/game.example/0.1.1" {
|
||||
t.Fatalf("expected manifest registration to refresh existing plugin, got %+v", refreshed)
|
||||
}
|
||||
listed = getJSON[dto.GamePluginListResponse](t, router, "/api/v1/game-plugins?serverType=example&status=installed")
|
||||
assertListCount(t, listed.Count, 1)
|
||||
}
|
||||
|
||||
func TestPluginMarketplaceAPIListsDetailsAndChangesStateSafely(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user