[GraphQL] add better errors when attachments are not properly used

This commit is contained in:
Paul Chavard 2020-11-12 20:07:42 +01:00
parent 68b849c827
commit b897e0cc1c
6 changed files with 56 additions and 0 deletions

View file

@ -604,6 +604,34 @@ describe API::V2::GraphqlController do
})
end
end
context 'upload error' do
let(:query) do
"mutation {
dossierEnvoyerMessage(input: {
dossierId: \"#{dossier.to_typed_id}\",
instructeurId: \"#{instructeur.to_typed_id}\",
body: \"Hello world\",
attachment: \"fake\"
}) {
message {
body
}
errors {
message
}
}
}"
end
it "should fail" do
expect(gql_errors).to eq(nil)
expect(gql_data).to eq(dossierEnvoyerMessage: {
errors: [{ message: "Lidentifiant du fichier téléversé est invalide" }],
message: nil
})
end
end
end
describe 'dossierPasserEnInstruction' do