From 59ee28b634fbcc400b714e0f01f611e40e74fcaf Mon Sep 17 00:00:00 2001 From: Sunli Date: Mon, 7 Jun 2021 14:12:28 +0800 Subject: [PATCH] Update tests --- tests/result.rs | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/result.rs b/tests/result.rs index 8fcbe04b..658b2059 100644 --- a/tests/result.rs +++ b/tests/result.rs @@ -23,13 +23,30 @@ pub async fn test_fieldresult() { let schema = Schema::new(Query, EmptyMutation, EmptySubscription); assert_eq!( - schema.execute("{ error }").await.into_result().unwrap_err(), - vec![ServerError { - message: "TestError".to_string(), - locations: vec![Pos { line: 1, column: 3 }], - path: vec![PathSegment::Field("error".to_owned())], - extensions: None, - }] + schema.execute("{ error1:error error2:error }").await, + Response { + data: value!({ "error1": null, "error2": null }), + extensions: Default::default(), + cache_control: Default::default(), + 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!(