[GraphQL] allow to query dossiers by groupe instructeur
This commit is contained in:
parent
7e806f191c
commit
32f783142c
6 changed files with 149 additions and 0 deletions
|
@ -201,6 +201,7 @@ describe API::V2::GraphqlController do
|
|||
}
|
||||
groupeInstructeur {
|
||||
id
|
||||
number
|
||||
label
|
||||
}
|
||||
messages {
|
||||
|
@ -259,6 +260,7 @@ describe API::V2::GraphqlController do
|
|||
],
|
||||
groupeInstructeur: {
|
||||
id: dossier.groupe_instructeur.to_typed_id,
|
||||
number: dossier.groupe_instructeur.id,
|
||||
label: dossier.groupe_instructeur.label
|
||||
},
|
||||
demandeur: {
|
||||
|
@ -346,6 +348,36 @@ describe API::V2::GraphqlController do
|
|||
end
|
||||
end
|
||||
|
||||
context "groupeInstructeur" do
|
||||
let(:groupe_instructeur) { procedure.groupe_instructeurs.first }
|
||||
let(:query) do
|
||||
"{
|
||||
groupeInstructeur(number: #{groupe_instructeur.id}) {
|
||||
id
|
||||
number
|
||||
label
|
||||
dossiers {
|
||||
nodes {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}"
|
||||
end
|
||||
|
||||
it "should be returned" do
|
||||
expect(gql_errors).to eq(nil)
|
||||
expect(gql_data).to eq(groupeInstructeur: {
|
||||
id: groupe_instructeur.to_typed_id,
|
||||
number: groupe_instructeur.id,
|
||||
label: groupe_instructeur.label,
|
||||
dossiers: {
|
||||
nodes: dossiers.map { |dossier| { id: dossier.to_typed_id } }
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
context "mutations" do
|
||||
describe 'dossierEnvoyerMessage' do
|
||||
context 'success' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue