feat: 收口 tree-first graph 主链与前端测试修复
This commit is contained in:
@@ -237,6 +237,46 @@ mod tests {
|
||||
assert!(request.payload_json.contains("\"name\":\"documents.save\""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn document_embed_command_maps_to_documents_update_content() {
|
||||
let command = CommandEnvelope {
|
||||
name: "documents.embed".into(),
|
||||
command_id: "cmd_embed_1".into(),
|
||||
idempotency_key: Some("idem_embed".into()),
|
||||
actor: ActorPayload {
|
||||
actor_type: "human".into(),
|
||||
actor_id: "user_1".into(),
|
||||
session_id: Some("session_1".into()),
|
||||
},
|
||||
source: SourcePayload {
|
||||
channel: "next-route".into(),
|
||||
client: "wolai-frontend".into(),
|
||||
},
|
||||
target: Some(TargetRef {
|
||||
workspace_id: Some("ws_1".into()),
|
||||
page_id: Some("page_2".into()),
|
||||
block_id: None,
|
||||
}),
|
||||
payload: SavePageContent {
|
||||
page_id: "page_2".into(),
|
||||
workspace_id: Some("ws_1".into()),
|
||||
revision: Some(7),
|
||||
content_json: "{\"blocks\":[{\"id\":\"block_1\",\"type\":\"pageReference\"}]}".into(),
|
||||
conflict_detection_key: Some("rev:7".into()),
|
||||
},
|
||||
reason: Some("嵌入页面".into()),
|
||||
refs: vec!["checklist:p1-3".into()],
|
||||
dry_run: false,
|
||||
validate_only: false,
|
||||
};
|
||||
|
||||
let request =
|
||||
build_write_request(&demo_context(), &command).expect("write request should build");
|
||||
assert_eq!(request.function_name, "documents:updateContent");
|
||||
assert_eq!(request.workspace_id.as_deref(), Some("ws_1"));
|
||||
assert!(request.payload_json.contains("\"name\":\"documents.embed\""));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn page_lifecycle_commands_map_to_document_mutations() {
|
||||
let base_actor = ActorPayload {
|
||||
|
||||
Reference in New Issue
Block a user