helper.rs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. "",
  7. "annie@",
  8. "annie@gmail@",
  9. "#@%^%#$@#$@#.com",
  10. "@example.com",
  11. "Joe Smith <[email protected]>",
  12. "email.example.com",
  13. "email@[email protected]",
  14. "[email protected]",
  15. "[email protected]",
  16. "あいうえお@example.com",
  17. /* The following email is valid according to the validate_email function return
  18. * "[email protected]",
  19. * "[email protected]",
  20. * "[email protected]",
  21. * "email@example",
  22. * "[email protected]",
  23. * "[email protected]",
  24. * "[email protected]", */
  25. ]
  26. .iter()
  27. .map(|s| s.to_string())
  28. .collect::<Vec<_>>()
  29. }
  30. pub(crate) fn invalid_password_test_case() -> Vec<String> {
  31. vec!["", "123456", "1234".repeat(100).as_str()]
  32. .iter()
  33. .map(|s| s.to_string())
  34. .collect::<Vec<_>>()
  35. }
  36. pub(crate) fn valid_name() -> String { "AppFlowy".to_string() }