helper.rs 1.2 KB

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