helper.rs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. pub use flowy_test::{
  2. event_builder::*,
  3. prelude::{login_password, random_email},
  4. };
  5. pub(crate) fn invalid_email_test_case() -> Vec<String> {
  6. // https://gist.github.com/cjaoude/fd9910626629b53c4d25
  7. vec![
  8. "annie@",
  9. "annie@gmail@",
  10. "#@%^%#$@#$@#.com",
  11. "@example.com",
  12. "Joe Smith <[email protected]>",
  13. "email.example.com",
  14. "email@[email protected]",
  15. "[email protected]",
  16. "[email protected]",
  17. "あいうえお@example.com",
  18. /* The following email is valid according to the validate_email function return
  19. * "[email protected]",
  20. * "[email protected]",
  21. * "[email protected]",
  22. * "email@example",
  23. * "[email protected]",
  24. * "[email protected]",
  25. * "[email protected]", */
  26. ]
  27. .iter()
  28. .map(|s| s.to_string())
  29. .collect::<Vec<_>>()
  30. }
  31. pub(crate) fn invalid_password_test_case() -> Vec<String> {
  32. vec!["123456", "1234".repeat(100).as_str()]
  33. .iter()
  34. .map(|s| s.to_string())
  35. .collect::<Vec<_>>()
  36. }
  37. pub(crate) fn valid_name() -> String {
  38. "AppFlowy".to_string()
  39. }