test: restore mnote-web lib baseline
This commit is contained in:
@@ -2548,7 +2548,8 @@ mod tests {
|
||||
.expect("body");
|
||||
let admin_html = String::from_utf8(admin_body.to_vec()).expect("utf8");
|
||||
assert!(!admin_html.contains(r#"data-testid="mnote-admin-access-policy-entry""#));
|
||||
assert!(admin_html.contains(r#"data-testid="mnote-account-access-policy""#));
|
||||
assert!(admin_html.contains(r#"data-mnote-action="open-account-menu""#));
|
||||
assert!(admin_html.contains("/api/mnote-browser-runtime/sidebar-tree-runtime.js"));
|
||||
assert!(admin_html.contains(r#"data-testid="mnote-admin-access-policy-template-admin""#));
|
||||
assert!(admin_html.contains(r#"data-testid="mnote-admin-access-policy-template-user""#));
|
||||
|
||||
@@ -2571,7 +2572,8 @@ mod tests {
|
||||
.expect("body");
|
||||
let user_html = String::from_utf8(user_body.to_vec()).expect("utf8");
|
||||
assert!(!user_html.contains(r#"data-testid="mnote-admin-access-policy-entry""#));
|
||||
assert!(user_html.contains(r#"data-testid="mnote-account-access-policy""#));
|
||||
assert!(user_html.contains(r#"data-mnote-action="open-account-menu""#));
|
||||
assert!(user_html.contains("/api/mnote-browser-runtime/sidebar-tree-runtime.js"));
|
||||
assert!(user_html.contains(r#"data-testid="mnote-admin-access-policy-template-admin""#));
|
||||
assert!(user_html.contains(r#"data-testid="mnote-admin-access-policy-template-user""#));
|
||||
}
|
||||
@@ -3154,7 +3156,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn legacy_proxy_normalizes_auth_post_origin_to_upstream_origin() {
|
||||
async fn auth_api_no_longer_proxies_to_legacy_next_for_origin_normalization() {
|
||||
let legacy_base_url = spawn_legacy_origin_checked_upstream().await;
|
||||
let response = app_with_legacy_next_base_url(legacy_base_url)
|
||||
.oneshot(
|
||||
@@ -3169,18 +3171,19 @@ mod tests {
|
||||
.await
|
||||
.expect("response");
|
||||
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
assert_eq!(response.status(), StatusCode::BAD_REQUEST);
|
||||
assert_eq!(
|
||||
response
|
||||
.headers()
|
||||
.get("x-mnote-legacy-upstream")
|
||||
.get("x-mnote-web-owner")
|
||||
.and_then(|value| value.to_str().ok()),
|
||||
Some("next-app-router")
|
||||
Some("mnote-web")
|
||||
);
|
||||
assert!(response.headers().get("x-mnote-legacy-upstream").is_none());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn legacy_proxy_preserves_multiple_set_cookie_headers() {
|
||||
async fn auth_api_no_longer_uses_legacy_next_cookie_proxy() {
|
||||
let legacy_base_url = spawn_legacy_cookie_upstream().await;
|
||||
let response = app_with_legacy_next_base_url(legacy_base_url)
|
||||
.oneshot(
|
||||
@@ -3193,18 +3196,19 @@ mod tests {
|
||||
.await
|
||||
.expect("response");
|
||||
|
||||
assert_eq!(response.status(), StatusCode::OK);
|
||||
assert_eq!(response.status(), StatusCode::BAD_REQUEST);
|
||||
let cookies = response.headers().get_all("set-cookie");
|
||||
let values = cookies
|
||||
.iter()
|
||||
.map(|value| value.to_str().unwrap_or_default())
|
||||
.collect::<Vec<_>>();
|
||||
assert!(values
|
||||
assert!(!values
|
||||
.iter()
|
||||
.any(|value| value.contains("__convexAuthJWT=jwt-demo")));
|
||||
assert!(values
|
||||
.any(|value| value.contains("__convexAuthJWT=")));
|
||||
assert!(!values
|
||||
.iter()
|
||||
.any(|value| value.contains("__convexAuthRefreshToken=refresh-demo")));
|
||||
.any(|value| value.contains("__convexAuthRefreshToken=")));
|
||||
assert!(response.headers().get("x-mnote-legacy-upstream").is_none());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user