重构基线
This commit is contained in:
@@ -163,6 +163,7 @@ pub fn PageLayout(
|
||||
<div hidden data-testid="mnote-admin-access-policy-template-admin" inner_html={admin_access_policy_template}></div>
|
||||
<div hidden data-testid="mnote-admin-access-policy-template-user" inner_html={user_access_policy_template}></div>
|
||||
<script inner_html={crate::ssr::pages::admin::ADMIN_POLICY_SCRIPT.to_string()}></script>
|
||||
<script type="module" src={browser_runtime_src("mnote-ui-runtime.js")}></script>
|
||||
<script type="module" src={browser_runtime_src("resource-open-runtime.js")}></script>
|
||||
<script type="module" src={browser_runtime_src("local-upload-runtime.js")}></script>
|
||||
<script type="module" src={browser_runtime_src("filetree-runtime.js")}></script>
|
||||
@@ -206,6 +207,7 @@ pub fn PageLayout(
|
||||
<button type="button" data-testid="wolai-floating-ai" class="wolai-floating-button wolai-floating-button--ai" aria-label="AI 助手" data-state="closed" aria-haspopup="dialog" aria-expanded="false" title="点击 进入空间智能问答" data-mnote-action="open-page-ai"><span class="material-symbols-outlined material-symbols-filled" data-icon="auto_awesome" aria-hidden="true"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mnote-portal-root" data-mnote-portal-root="true"></div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -235,6 +237,7 @@ mod tests {
|
||||
// resume/journal contract checks inspect the actual shipped JS.
|
||||
const SIDEBAR_PAGE_AI_RUNTIME_JS: &str =
|
||||
include_str!("../../../browser/sidebar-page-ai-runtime.js");
|
||||
const MNOTE_UI_RUNTIME_JS: &str = include_str!("../../../browser/mnote-ui-runtime.js");
|
||||
const SIDEBAR_PAGE_AI_MARKDOWN_RUNTIME_JS: &str =
|
||||
include_str!("../../../browser/sidebar-page-ai-markdown-runtime.js");
|
||||
const SIDEBAR_PAGE_AI_RENDER_RUNTIME_JS: &str =
|
||||
@@ -418,6 +421,15 @@ mod tests {
|
||||
assert!(!html.contains(r#"data-testid="wolai-public-state">全网公开"#));
|
||||
assert!(html.contains(r#"data-mnote-action="toggle-sidebar-shortcut""#));
|
||||
assert!(html.contains(r#"data-mnote-shortcut-kind="page""#));
|
||||
assert!(html.contains(r#"id="mnote-portal-root""#));
|
||||
assert!(html.contains("/api/mnote-browser-runtime/mnote-ui-runtime.js"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mnote_ui_runtime_exposes_toast_api() {
|
||||
assert!(MNOTE_UI_RUNTIME_JS.contains("window.mnote.toast"));
|
||||
assert!(MNOTE_UI_RUNTIME_JS.contains("data-mnote-toast-region"));
|
||||
assert!(MNOTE_UI_RUNTIME_JS.contains("mnote:toast"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -445,6 +457,10 @@ mod tests {
|
||||
html.contains("/api/mnote-browser-runtime/local-folder-event-bus-runtime.js?devHot="),
|
||||
"dev:hot 下 local-folder event bus URL 必须带 cache buster,避免复用旧连接编排逻辑"
|
||||
);
|
||||
assert!(
|
||||
html.contains("/api/mnote-browser-runtime/mnote-ui-runtime.js?devHot="),
|
||||
"dev:hot 下 UI runtime URL 必须带 cache buster,避免 toast/portal 使用旧版本"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user