refactor: split tree shell filetree helpers

This commit is contained in:
lix-2026
2026-05-26 02:53:12 +08:00
parent b8a067ce9f
commit 19642cdd7b
6 changed files with 206 additions and 172 deletions
+6 -1
View File
@@ -2393,6 +2393,8 @@ pub async fn reduce_tree_shell_runtime(
#[cfg(test)]
mod tests {
const TREE_SHELL_RUNTIME_JS: &str = include_str!("../../browser/tree-shell-runtime.js");
const TREE_SHELL_FILETREE_RUNTIME_JS: &str =
include_str!("../../browser/tree-shell-filetree-runtime.js");
use super::{
collect_filetree_render_rows, create_command_wire, TreeCommandEnvelopeContext,
@@ -2673,7 +2675,10 @@ mod tests {
assert!(TREE_SHELL_RUNTIME_JS.contains("tree.filetree.external-drop"));
assert!(html.contains("\"rowKind\":\"asset_folder\""));
assert!(html.contains("\"resourceMeta\""));
assert!(TREE_SHELL_RUNTIME_JS.contains("const getFileTreeRowOwnerDocumentId = (item) => {"));
assert!(TREE_SHELL_RUNTIME_JS.contains("tree-shell-filetree-runtime.js"));
assert!(
TREE_SHELL_FILETREE_RUNTIME_JS.contains("function getFileTreeRowOwnerDocumentId(item)")
);
assert!(TREE_SHELL_RUNTIME_JS
.contains("row.dataset.ownerDocumentId = ownerDocumentId || \"\";"));
assert!(