fix: 调试发布run
This commit is contained in:
@@ -162,12 +162,16 @@ describe("first-party console pages", () => {
|
||||
it("submits declared runtime profiles and logical bindings from the create workflow", () => {
|
||||
expect(serversPageSource).toContain("<ManagementDialog");
|
||||
expect(serversPageSource).toContain('className="provider-form dialog-form"');
|
||||
expect(serversPageSource).toContain('name="name"');
|
||||
expect(serversPageSource).toContain('name="profileKey"');
|
||||
expect(serversPageSource).toContain("runtimeBindingFields");
|
||||
expect(serversPageSource).toContain("createProfileUnavailable");
|
||||
expect(serversPageSource).toContain("当前插件没有声明运行配置");
|
||||
expect(serversPageSource).toContain("updateBinding(field.key");
|
||||
expect(serversPageSource).toContain('type={field.sensitive ? "password" : "text"}');
|
||||
expect(serversPageSource).toContain("serverCreateRequestFromForm(form)");
|
||||
expect(serversPageSource).not.toContain('name="id"');
|
||||
expect(serversPageSource).not.toContain("实例 ID");
|
||||
for (const forbidden of ["secret://", "/Users/", "/var/run/", "unix://", "tcp://"]) {
|
||||
expect(serversPageSource).not.toContain(forbidden);
|
||||
}
|
||||
@@ -181,10 +185,41 @@ describe("first-party console pages", () => {
|
||||
expect(serversPageSource).not.toContain("<details");
|
||||
});
|
||||
|
||||
it("places server deletion in the list runtime actions with password confirmation", () => {
|
||||
const deleteHandlerSource = serversPageSource.split("async function handleDeleteServer")[1]?.split("function openRunTargetSelection")[0] ?? "";
|
||||
expect(serversPageSource).toContain("deleteServerInstance(deleteConfirmation.serverInstanceId, { password: deletePassword })");
|
||||
expect(serversPageSource).toContain("serverDeleteConfirmation(card.instance)");
|
||||
expect(serversPageSource).toContain("serverDeleteDisabledReason(session, card.instance)");
|
||||
expect(serversPageSource).toContain("危险操作");
|
||||
expect(serversPageSource).toContain("删除服务器");
|
||||
expect(serversPageSource).toContain("请输入当前登录密码");
|
||||
expect(serversPageSource).toContain("canOpenActions");
|
||||
expect(deleteHandlerSource).toContain("await refresh();");
|
||||
expect(deleteHandlerSource).not.toContain("onNavigate");
|
||||
expect(serverDetailPageSource).not.toContain("deleteServerInstance");
|
||||
expect(serverDetailPageSource).not.toContain("serverDeleteConfirmation");
|
||||
});
|
||||
|
||||
it("surfaces runtime actions through progress dialogs with build stages", () => {
|
||||
const generateRunSource = serversPageSource.split("async function generateRunForTarget")[1]?.split("async function handleQuickRuntimeAction")[0] ?? "";
|
||||
expect(serversPageSource).toContain("RuntimeTaskProgressDialog");
|
||||
expect(serversPageSource).toContain("选择生成平台");
|
||||
expect(serversPageSource).toContain("runTargetSelection");
|
||||
expect(serversPageSource).toContain("runtimeRunBuildStages");
|
||||
expect(serversPageSource).toContain("requireQuickRuntimeActionAvailable(instance.id, action)");
|
||||
expect(serversPageSource).toContain("该操作不可用");
|
||||
expect(generateRunSource.indexOf("runtimeTask.runTrackedTask")).toBeLessThan(generateRunSource.indexOf('await requireQuickRuntimeActionAvailable(instance.id, "generate-run")'));
|
||||
expect(serverDetailPageSource).toContain("RuntimeTaskProgressDialog");
|
||||
expect(serverDetailPageSource).toContain("runtimeRunBuildStages");
|
||||
expect(runtimeTaskProgressSource).toContain("runtimeBuildStages");
|
||||
expect(runtimeTaskProgressSource).toContain("runtimeRunBuildStages");
|
||||
expect(runtimeTaskProgressSource).toContain("进度展示");
|
||||
expect(runtimeTaskProgressSource).toContain("activeStepLabel");
|
||||
expect(runtimeTaskProgressSource).toContain("平台正在执行当前阶段");
|
||||
expect(runtimeTaskProgressSource).toContain("拉取 run 更新");
|
||||
expect(runtimeTaskProgressSource).toContain("检测构建环境");
|
||||
expect(runtimeTaskProgressSource).toContain("构建中");
|
||||
expect(runtimeTaskProgressSource).toContain("构建完成");
|
||||
expect(runtimeTaskProgressSource).toContain("拉取代码");
|
||||
expect(runtimeTaskProgressSource).toContain("安装环境");
|
||||
expect(runtimeTaskProgressSource).toContain("编译构建");
|
||||
|
||||
Reference in New Issue
Block a user