Update tests

This commit is contained in:
Sunli 2021-06-07 14:12:28 +08:00
parent 588a7e40e8
commit 59ee28b634

View File

@ -23,13 +23,30 @@ pub async fn test_fieldresult() {
let schema = Schema::new(Query, EmptyMutation, EmptySubscription); let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
assert_eq!( assert_eq!(
schema.execute("{ error }").await.into_result().unwrap_err(), schema.execute("{ error1:error error2:error }").await,
vec![ServerError { Response {
message: "TestError".to_string(), data: value!({ "error1": null, "error2": null }),
locations: vec![Pos { line: 1, column: 3 }], extensions: Default::default(),
path: vec![PathSegment::Field("error".to_owned())], cache_control: Default::default(),
extensions: None, errors: vec![
}] ServerError {
message: "TestError".to_string(),
locations: vec![Pos { line: 1, column: 3 }],
path: vec![PathSegment::Field("error1".to_owned())],
extensions: None,
},
ServerError {
message: "TestError".to_string(),
locations: vec![Pos {
line: 1,
column: 16,
}],
path: vec![PathSegment::Field("error2".to_owned())],
extensions: None,
},
],
http_headers: Default::default(),
}
); );
assert_eq!( assert_eq!(