Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 03:11:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-18 03:11:02 +0300
commitc95fc172145f1bdbc8d959b6cee31555fc545784 (patch)
tree5aa4940ddefb9bea164905d61916593cc265a05c /spec/graphql/resolvers/crm/organizations_resolver_spec.rb
parenteda321fc0b96e44e296341f6288dd7f1a27ba93a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql/resolvers/crm/organizations_resolver_spec.rb')
-rw-r--r--spec/graphql/resolvers/crm/organizations_resolver_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/graphql/resolvers/crm/organizations_resolver_spec.rb b/spec/graphql/resolvers/crm/organizations_resolver_spec.rb
index 323f134ffc3..d5980bf3c41 100644
--- a/spec/graphql/resolvers/crm/organizations_resolver_spec.rb
+++ b/spec/graphql/resolvers/crm/organizations_resolver_spec.rb
@@ -55,11 +55,23 @@ RSpec.describe Resolvers::Crm::OrganizationsResolver do
end
context 'when no filter is provided' do
- it 'returns all the organizations in the correct order' do
+ it 'returns all the organizations in the default order' do
expect(resolve_organizations(group)).to eq([organization_a, organization_b])
end
end
+ context 'when a sort is provided' do
+ it 'returns all the organizations in the correct order' do
+ expect(resolve_organizations(group, { sort: 'NAME_DESC' })).to eq([organization_b, organization_a])
+ end
+ end
+
+ context 'when filtering for all states' do
+ it 'returns all the organizations' do
+ expect(resolve_organizations(group, { state: 'all' })).to contain_exactly(organization_a, organization_b)
+ end
+ end
+
context 'when search term is provided' do
it 'returns the correct organizations' do
expect(resolve_organizations(group, { search: "def" })).to contain_exactly(organization_b)