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:
authorLuke Bennett <lbennett@gitlab.com>2019-01-30 07:42:50 +0300
committerEzekiel Kigbo <ekigbo@gitlab.com>2019-03-04 16:58:21 +0300
commit6b3966407baff221a0f1f9019fba34c29bafa087 (patch)
treec294bce622f52739f2daabe1aef86c01f3046b5e /spec/support/shared_examples/views
parentfde3f619ba557d5242b4fec07488b05398b4993d (diff)
Add tests for nav sidebar collapsed on render
Adds rspec view tests that expect the nav sidebar to have a class that will cause the nav sidebar to be rendered collapsed with or without js. Tests the nav sidebar on the admin, group, instance statistics, user profile and project sidebars.
Diffstat (limited to 'spec/support/shared_examples/views')
-rw-r--r--spec/support/shared_examples/views/nav_sidebar.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/shared_examples/views/nav_sidebar.rb b/spec/support/shared_examples/views/nav_sidebar.rb
new file mode 100644
index 00000000000..3e709c8ab77
--- /dev/null
+++ b/spec/support/shared_examples/views/nav_sidebar.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+shared_examples 'has nav sidebar' do
+ it 'has collapsed nav sidebar on mobile' do
+ render
+
+ expect(rendered).to have_selector('.nav-sidebar.sidebar-collapsed-mobile')
+ end
+end