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-05 21:08:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-05 21:08:56 +0300
commit092e41f5660a356a6cebc26cd0274b531d8c70c6 (patch)
treee696f9ad230bc5d5a7222fb690e3699a1a8abe78 /spec/models
parent8ec882085e734458ffe0fff8e2e4b72bc3871419 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/work_item_spec.rb1
-rw-r--r--spec/models/work_items/type_spec.rb1
-rw-r--r--spec/models/work_items/widgets/labels_spec.rb31
3 files changed, 33 insertions, 0 deletions
diff --git a/spec/models/work_item_spec.rb b/spec/models/work_item_spec.rb
index 98ba702da25..e2240c225a9 100644
--- a/spec/models/work_item_spec.rb
+++ b/spec/models/work_item_spec.rb
@@ -43,6 +43,7 @@ RSpec.describe WorkItem do
is_expected.to include(
instance_of(WorkItems::Widgets::Description),
instance_of(WorkItems::Widgets::Hierarchy),
+ instance_of(WorkItems::Widgets::Labels),
instance_of(WorkItems::Widgets::Assignees),
instance_of(WorkItems::Widgets::StartAndDueDate)
)
diff --git a/spec/models/work_items/type_spec.rb b/spec/models/work_items/type_spec.rb
index ec0b5536546..e41df7f0f61 100644
--- a/spec/models/work_items/type_spec.rb
+++ b/spec/models/work_items/type_spec.rb
@@ -67,6 +67,7 @@ RSpec.describe WorkItems::Type do
is_expected.to include(
::WorkItems::Widgets::Description,
::WorkItems::Widgets::Hierarchy,
+ ::WorkItems::Widgets::Labels,
::WorkItems::Widgets::Assignees,
::WorkItems::Widgets::StartAndDueDate
)
diff --git a/spec/models/work_items/widgets/labels_spec.rb b/spec/models/work_items/widgets/labels_spec.rb
new file mode 100644
index 00000000000..15e8aaa1cf3
--- /dev/null
+++ b/spec/models/work_items/widgets/labels_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe WorkItems::Widgets::Labels do
+ let_it_be(:work_item) { create(:work_item, labels: [create(:label)]) }
+
+ describe '.type' do
+ subject { described_class.type }
+
+ it { is_expected.to eq(:labels) }
+ end
+
+ describe '#type' do
+ subject { described_class.new(work_item).type }
+
+ it { is_expected.to eq(:labels) }
+ end
+
+ describe '#labels' do
+ subject { described_class.new(work_item).labels }
+
+ it { is_expected.to eq(work_item.labels) }
+ end
+
+ describe '#allowScopedLabels' do
+ subject { described_class.new(work_item).allows_scoped_labels? }
+
+ it { is_expected.to eq(work_item.allows_scoped_labels?) }
+ end
+end