Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab
Commits
b99471ca
Commit
b99471ca
authored
8 years ago
by
Fatih Acet
Browse files
Options
Downloads
Patches
Plain Diff
Added specs for right sidebar.
parent
e2450ccf
No related branches found
No related tags found
1 merge request
!425
CE upstream
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/javascripts/fixtures/right_sidebar.html.haml
+13
-0
13 additions, 0 deletions
spec/javascripts/fixtures/right_sidebar.html.haml
spec/javascripts/right_sidebar_spec.js.coffee
+69
-0
69 additions, 0 deletions
spec/javascripts/right_sidebar_spec.js.coffee
with
82 additions
and
0 deletions
spec/javascripts/fixtures/right_sidebar.html.haml
0 → 100644
+
13
−
0
View file @
b99471ca
%div
%div
.page-gutter.page-with-sidebar
%aside
.right-sidebar
%div
.block.issuable-sidebar-header
%a
.gutter-toggle.pull-right.js-sidebar-toggle
%i
.fa.fa-angle-double-left
%form
.issuable-context-form
%div
.block.labels
%div
.sidebar-collapsed-icon
%i
.fa.fa-tags
%span
1
This diff is collapsed.
Click to expand it.
spec/javascripts/right_sidebar_spec.js.coffee
0 → 100644
+
69
−
0
View file @
b99471ca
#= require right_sidebar
#= require jquery
#= require jquery.cookie
@
sidebar
=
null
$aside
=
null
$toggle
=
null
$icon
=
null
$page
=
null
$labelsIcon
=
null
assertSidebarState
=
(
state
)
->
shouldBeExpanded
=
state
is
'expanded'
shouldBeCollapsed
=
state
is
'collapsed'
expect
(
$aside
.
hasClass
(
'right-sidebar-expanded'
)).
toBe
shouldBeExpanded
expect
(
$page
.
hasClass
(
'right-sidebar-expanded'
)).
toBe
shouldBeExpanded
expect
(
$icon
.
hasClass
(
'fa-angle-double-right'
)).
toBe
shouldBeExpanded
expect
(
$aside
.
hasClass
(
'right-sidebar-collapsed'
)).
toBe
shouldBeCollapsed
expect
(
$page
.
hasClass
(
'right-sidebar-collapsed'
)).
toBe
shouldBeCollapsed
expect
(
$icon
.
hasClass
(
'fa-angle-double-left'
)).
toBe
shouldBeCollapsed
describe
'RightSidebar'
,
->
fixture
.
preload
'right_sidebar.html'
beforeEach
->
fixture
.
load
'right_sidebar.html'
@
sidebar
=
new
Sidebar
$aside
=
$
'.right-sidebar'
$page
=
$
'.page-with-sidebar'
$icon
=
$aside
.
find
'i'
$toggle
=
$aside
.
find
'.js-sidebar-toggle'
$labelsIcon
=
$aside
.
find
'.sidebar-collapsed-icon'
it
'should expand the sidebar when arrow is clicked'
,
->
$toggle
.
click
()
assertSidebarState
'expanded'
it
'should collapse the sidebar when arrow is clicked'
,
->
$toggle
.
click
()
assertSidebarState
'expanded'
$toggle
.
click
()
assertSidebarState
'collapsed'
it
'should float over the page and when sidebar icons clicked'
,
->
$labelsIcon
.
click
()
assertSidebarState
'expanded'
it
'should collapse when the icon arrow clicked while it is floating on page'
,
->
$labelsIcon
.
click
()
assertSidebarState
'expanded'
$toggle
.
click
()
assertSidebarState
'collapsed'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment