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-09-23 09:10:24 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-23 09:10:24 +0300
commit17569e185c449d7b0fd6246b53b348afb9e61ca4 (patch)
treecad5654a801bda71085bc70ecfa00dfb0eb9322e /spec/components/pajamas
parent8c1c323ac04b24b1167540893af699928ce8c156 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/components/pajamas')
-rw-r--r--spec/components/pajamas/progress_component_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/components/pajamas/progress_component_spec.rb b/spec/components/pajamas/progress_component_spec.rb
new file mode 100644
index 00000000000..5172f459a84
--- /dev/null
+++ b/spec/components/pajamas/progress_component_spec.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+RSpec.describe Pajamas::ProgressComponent, type: :component do
+ before do
+ render_inline(described_class.new(value: value, variant: variant))
+ end
+
+ let(:value) { 33 }
+ let(:variant) { nil }
+
+ describe "value" do
+ it "sets the width of the progressbar" do
+ expect(page).to have_css ".progress-bar[style='width: #{value}%;']"
+ end
+ end
+
+ describe "variant" do
+ where(:variant) { [:primary, :success] }
+
+ with_them do
+ it "adds variant class" do
+ expect(page).to have_css ".progress-bar.bg-#{variant}"
+ end
+ end
+
+ context "with unknown variant" do
+ let(:variant) { :nope }
+
+ it "adds the default variant class" do
+ expect(page).to have_css ".progress-bar.bg-primary"
+ end
+ end
+ end
+end