Allow deleting draft server records

This commit is contained in:
npc0-hue
2026-08-04 15:55:39 +08:00
parent cf9af14eaf
commit ee02974ff8
3 changed files with 31 additions and 1 deletions
+14
View File
@@ -287,6 +287,20 @@ func TestValidateServerInstanceRejectsDeletedCreateState(t *testing.T) {
}
}
func TestValidateStoredServerInstanceAllowsDeletedWithoutRunEndpoint(t *testing.T) {
instance := domain.ServerInstance{
ID: "server-1",
PluginID: "server.scum",
PluginVersion: "1.0.0",
Name: "SCUM #1",
State: domain.ServerInstanceStateDeleted,
}
if err := ValidateStoredServerInstance(instance); err != nil {
t.Fatalf("expected stored deleted instance without run endpoint to validate, got %v", err)
}
}
func TestValidateJobBoundsProgress(t *testing.T) {
job := domain.Job{
ID: "job-1",