message: Test login prompt
diff: @@ -35,10 +35,17 @@ impl Login {
  }
  _ => "Please paste the login token".to_string(),
  };
  + #[cfg(test)]
  + {
  + Ok(login_prompt)
  + }
  + #[cfg(not(test))]
  + {
  Input::new().with_prompt(&login_prompt).interact_text()
  }
  }
  }
  + }
  /// execute [List]
  pub fn execute(&self) -> Result<(), anyhow::Error> {
  @@ -47,3 +54,23 @@ impl Login {
  .map_err(|e| anyhow::anyhow!("{e}"))
  }
  }
  +
  +#[test]
  +fn test_login_2() {
  + let login = Login {
  + registry: "wapm.dev".to_string(),
  + token: None,
  + };
  +
  + assert_eq!(
  + login.get_token_or_ask_user().unwrap(),
  + "Please paste the login token for https://wapm.dev/me"
  + );
  +
  + let login = Login {
  + registry: "wapm.dev".to_string(),
  + token: Some("abc".to_string()),
  + };
  +
  + assert_eq!(login.get_token_or_ask_user().unwrap(), "abc");
  +}
  