BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b99471ca
Commit
b99471ca
authored
May 12, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs for right sidebar.
parent
e2450ccf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
right_sidebar.html.haml
spec/javascripts/fixtures/right_sidebar.html.haml
+13
-0
right_sidebar_spec.js.coffee
spec/javascripts/right_sidebar_spec.js.coffee
+69
-0
No files found.
spec/javascripts/fixtures/right_sidebar.html.haml
0 → 100644
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
spec/javascripts/right_sidebar_spec.js.coffee
0 → 100644
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'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment