fix: expose server deployment trigger
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import type { GamePluginResponse } from "../api/types";
|
||||
import { defaultServerCreateForm, runtimeBindingFields } from "../contracts/serverManagement";
|
||||
import { canDeployServer, defaultServerCreateForm, runtimeBindingFields } from "../contracts/serverManagement";
|
||||
import { serverCreateRequestFromForm, serverInstanceIdFromName } from "./serverManagement";
|
||||
|
||||
const plugin: GamePluginResponse = {
|
||||
@@ -42,6 +42,13 @@ const plugin: GamePluginResponse = {
|
||||
};
|
||||
|
||||
describe("runtime profile server creation contracts", () => {
|
||||
it("allows deployment only from draft or failed server states", () => {
|
||||
expect(canDeployServer("draft")).toBe(true);
|
||||
expect(canDeployServer("failed")).toBe(true);
|
||||
expect(canDeployServer("installing")).toBe(false);
|
||||
expect(canDeployServer("ready")).toBe(false);
|
||||
});
|
||||
|
||||
it("derives logical binding fields from the selected profile", () => {
|
||||
expect(runtimeBindingFields(plugin, "local")).toEqual([
|
||||
{ key: "java-runtime", required: false, sensitive: false },
|
||||
|
||||
Reference in New Issue
Block a user