test(app-iced, presenter): M114 出图补三个取证态(第三方站失败 / 离线失败 / 中文错误码)
- mock 增 `authlib-failed` 场景:AuthlibLoginChanged(Failed, NotAuthlibServer),原文只进日志 - `ULL_ACCOUNT_STATE=notice` 现在同时打开离线面板(截图能看到「表单 + 失败横幅」同屏) - 新增**截图专用**语言开关 `ULL_LANG=zh`(仅在 `--screenshot` 下生效):D30 要求错误码文案 中英各一张图,交互模式仍钉死 Lang::En(与产品行为一致)
This commit is contained in:
1 parent
9d0d985b1b
commit
73badb8a02
7 files changed
+128
-81
No files matched your search
@@ -80,6 +80,9 @@ impl MockBackend {
|
||||
if let Some(view) = accounts_screen::device_login(&scenario) {
|
||||
self.emit(AppEvent::Core(CoreEvent::DeviceLoginChanged(view)));
|
||||
}
|
||||
if let Some(view) = accounts_screen::authlib_login(&scenario) {
|
||||
self.emit(AppEvent::Core(CoreEvent::AuthlibLoginChanged(view)));
|
||||
}
|
||||
if let Some(notice) = accounts_screen::notice(&scenario) {
|
||||
self.emit(AppEvent::Core(CoreEvent::AccountNoticeChanged(Some(
|
||||
notice,
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
//! M114 的口径)。所以截图里皮肤区显示的是首字母块 + 「没有可用皮肤」。
|
||||
|
||||
use crate::dto::{
|
||||
AccountKind, AccountNotice, AccountNoticeCode, AccountView, DeviceLoginView, LoginFailure,
|
||||
AccountKind, AccountNotice, AccountNoticeCode, AccountView, AuthlibLoginView, DeviceLoginView,
|
||||
LoginFailure,
|
||||
};
|
||||
|
||||
/// 场景名(`ULL_ACCOUNT_STATE`;未知值按 `list` 处理)。
|
||||
@@ -80,6 +81,23 @@ pub(super) fn device_login(scenario: &str) -> Option<DeviceLoginView> {
|
||||
}
|
||||
}
|
||||
|
||||
/// 场景对应的**第三方站**登录状态(`authlib-failed` = 地址不是 authlib 服务器)。
|
||||
///
|
||||
/// 原文(中文诊断)只进日志;页面据 `failure` 码出 i18n(复审 r1 P1-1 的第三方轨那一半)。
|
||||
pub(super) fn authlib_login(scenario: &str) -> Option<AuthlibLoginView> {
|
||||
match scenario {
|
||||
"authlib-failed" => Some(AuthlibLoginView {
|
||||
phase: crate::dto::DeviceLoginPhase::Failed,
|
||||
server: "https://example.invalid/api/yggdrasil/".to_string(),
|
||||
server_name: String::new(),
|
||||
message: "服务器返回 HTTP 404(不像可用的 authlib 认证服务器)".to_string(),
|
||||
failure: Some(LoginFailure::NotAuthlibServer),
|
||||
account_name: String::new(),
|
||||
}),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// 场景对应的横幅(`notice` = 离线名字不合法那条;`added` = 添加成功的正向样例)。
|
||||
pub(super) fn notice(scenario: &str) -> Option<AccountNotice> {
|
||||
match scenario {
|
||||
|
||||
Reference in new issue
Block a user