Update tests to use DateTime's for timestamps
This commit is contained in:
parent
7b7294433b
commit
ab4435a79f
|
@ -2,6 +2,8 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
use std::str::FromStr;
|
||||||
|
use chrono::DateTime;
|
||||||
use chorus::types::{LoginSchema, RegisterSchema};
|
use chorus::types::{LoginSchema, RegisterSchema};
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
@ -16,7 +18,7 @@ async fn test_registration() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let reg = RegisterSchema {
|
let reg = RegisterSchema {
|
||||||
username: "Hiiii".into(),
|
username: "Hiiii".into(),
|
||||||
date_of_birth: Some("2000-01-01".to_string()),
|
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()),
|
||||||
consent: true,
|
consent: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
@ -32,7 +34,7 @@ async fn test_login() {
|
||||||
username: "Hiiii".into(),
|
username: "Hiiii".into(),
|
||||||
email: Some("testuser1@integrationtesting.xyz".into()),
|
email: Some("testuser1@integrationtesting.xyz".into()),
|
||||||
password: Some("Correct-Horse-Battery-Staple1".into()),
|
password: Some("Correct-Horse-Battery-Staple1".into()),
|
||||||
date_of_birth: Some("2000-01-01".to_string()),
|
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()),
|
||||||
consent: true,
|
consent: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
@ -54,7 +56,7 @@ async fn test_wrong_login() {
|
||||||
username: "Hiiii".into(),
|
username: "Hiiii".into(),
|
||||||
email: Some("testuser2@integrationtesting.xyz".into()),
|
email: Some("testuser2@integrationtesting.xyz".into()),
|
||||||
password: Some("Correct-Horse-Battery-Staple1".into()),
|
password: Some("Correct-Horse-Battery-Staple1".into()),
|
||||||
date_of_birth: Some("2000-01-01".to_string()),
|
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()),
|
||||||
consent: true,
|
consent: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
use std::str::FromStr;
|
||||||
|
use chrono::DateTime;
|
||||||
use chorus::gateway::Gateway;
|
use chorus::gateway::Gateway;
|
||||||
use chorus::types::IntoShared;
|
use chorus::types::IntoShared;
|
||||||
use chorus::{
|
use chorus::{
|
||||||
|
@ -30,7 +32,7 @@ impl TestBundle {
|
||||||
let register_schema = RegisterSchema {
|
let register_schema = RegisterSchema {
|
||||||
username: username.to_string(),
|
username: username.to_string(),
|
||||||
consent: true,
|
consent: true,
|
||||||
date_of_birth: Some("2000-01-01".to_string()),
|
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
self.instance
|
self.instance
|
||||||
|
@ -60,7 +62,7 @@ pub(crate) async fn setup() -> TestBundle {
|
||||||
let reg = RegisterSchema {
|
let reg = RegisterSchema {
|
||||||
username: "integrationtestuser".into(),
|
username: "integrationtestuser".into(),
|
||||||
consent: true,
|
consent: true,
|
||||||
date_of_birth: Some("2000-01-01".to_string()),
|
date_of_birth: Some(DateTime::from_str("2000-01-01").unwrap()),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let guild_create_schema = GuildCreateSchema {
|
let guild_create_schema = GuildCreateSchema {
|
||||||
|
|
Loading…
Reference in New Issue