context'when invalid linkType argument is provided'do
it'errors with a string'do
query_issue_links('"created"')
expect(graphql_errors).toinclude(a_hash_including('message'=>"Argument 'linkType' on Field 'issueLinks' has an invalid value (\"created\"). Expected type 'VulnerabilityIssueLinkType'."))
end
it'errors with a number'do
query_issue_links(1)
expect(graphql_errors).toinclude(a_hash_including('message'=>"Argument 'linkType' on Field 'issueLinks' has an invalid value (1). Expected type 'VulnerabilityIssueLinkType'."))
end
it'errors with lowercased `created`'do
query_issue_links('created')
expect(graphql_errors).toinclude(a_hash_including('message'=>"Argument 'linkType' on Field 'issueLinks' has an invalid value (created). Expected type 'VulnerabilityIssueLinkType'."))
end
it'errors with lowercased `related`'do
query_issue_links('related')
expect(graphql_errors).toinclude(a_hash_including('message'=>"Argument 'linkType' on Field 'issueLinks' has an invalid value (related). Expected type 'VulnerabilityIssueLinkType'."))
end
end
context'when valid linkType argument is provided'do
it'returns a list of VulnerabilityIssueLink with `CREATED` linkType'do
query_issue_links('CREATED')
expect_issue_links_response(created_issue)
end
it'returns a list of VulnerabilityIssueLink with `RELATED` linkType'do
query_issue_links('RELATED')
expect_issue_links_response(related_issue)
end
end
context'when no arguments are provided'do
it'returns a list of all VulnerabilityIssueLink'do