feat(web): 立项向导确认步/故事结构分段控件/书名必填提示 + 作品卡键盘焦点可见 + 作品库分段切换

This commit is contained in:
Yaojia Wang
2026-06-30 08:56:22 +02:00
parent a22a16c9c4
commit e82aff7067
5 changed files with 138 additions and 103 deletions

View File

@@ -5,11 +5,22 @@ import {
canSubmit,
clampStep,
emptyWizardForm,
STEP_TITLES,
toCreateRequest,
WIZARD_STEPS,
type WizardForm,
} from "./wizard";
describe("wizard step metadata", () => {
it("provides one title per step", () => {
expect(STEP_TITLES).toHaveLength(WIZARD_STEPS);
});
it("ends on a confirmation step rather than an empty world step", () => {
expect(STEP_TITLES[WIZARD_STEPS - 1]).toBe("确认与提交");
});
});
describe("wizard step gating", () => {
it("blocks advancing past step 1 without a title", () => {
expect(canAdvance(1, emptyWizardForm)).toBe(false);