Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f1710bd1
Commit
f1710bd1
authored
Feb 14, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete sidebar specs and fixtures; update shortcuts_spec to check page title
parent
8c1b41f1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
174 deletions
+5
-174
spec/features/dashboard/shortcuts_spec.rb
spec/features/dashboard/shortcuts_spec.rb
+5
-6
spec/javascripts/dashboard_spec.js.es6
spec/javascripts/dashboard_spec.js.es6
+0
-37
spec/javascripts/fixtures/dashboard.html.haml
spec/javascripts/fixtures/dashboard.html.haml
+0
-45
spec/javascripts/project_dashboard_spec.js.es6
spec/javascripts/project_dashboard_spec.js.es6
+0
-86
No files found.
spec/features/dashboard/shortcuts_spec.rb
View file @
f1710bd1
...
@@ -10,21 +10,20 @@ feature 'Dashboard shortcuts', feature: true, js: true do
...
@@ -10,21 +10,20 @@ feature 'Dashboard shortcuts', feature: true, js: true do
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'p'
)
find
(
'body'
).
native
.
send_key
(
'p'
)
ensure_active_main_tab
(
'Projects'
)
check_page_title
(
'Projects'
)
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'i'
)
find
(
'body'
).
native
.
send_key
(
'i'
)
ensure_active_main_tab
(
'Issues'
)
check_page_title
(
'Issues'
)
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'g'
)
find
(
'body'
).
native
.
send_key
(
'm'
)
find
(
'body'
).
native
.
send_key
(
'm'
)
ensure_active_main_tab
(
'Merge Requests'
)
check_page_title
(
'Merge Requests'
)
end
end
def
ensure_active_main_tab
(
content
)
def
check_page_title
(
title
)
find
(
'.global-dropdown-toggle'
).
trigger
(
'click'
)
expect
(
find
(
'.header-content .title'
)).
to
have_content
(
title
)
expect
(
find
(
'.global-dropdown-menu li.active'
)).
to
have_content
(
content
)
end
end
end
end
spec/javascripts/dashboard_spec.js.es6
deleted
100644 → 0
View file @
8c1b41f1
/* eslint-disable no-new */
require('~/sidebar');
require('~/lib/utils/text_utility');
((global) => {
describe('Dashboard', () => {
const fixtureTemplate = 'static/dashboard.html.raw';
function todosCountText() {
return $('.js-todos-count').text();
}
function triggerToggle(newCount) {
$(document).trigger('todo:toggle', newCount);
}
preloadFixtures(fixtureTemplate);
beforeEach(() => {
loadFixtures(fixtureTemplate);
new global.Sidebar();
});
it('should update todos-count after receiving the todo:toggle event', () => {
triggerToggle(5);
expect(todosCountText()).toEqual('5');
});
it('should display todos-count with delimiter', () => {
triggerToggle(1000);
expect(todosCountText()).toEqual('1,000');
triggerToggle(1000000);
expect(todosCountText()).toEqual('1,000,000');
});
});
})(window.gl);
spec/javascripts/fixtures/dashboard.html.haml
deleted
100644 → 0
View file @
8c1b41f1
%ul
.nav.nav-sidebar
%li
.home.active
%a
.dashboard-shortcuts-projects
%span
Projects
%li
%a
%span
Todos
%span
.count.js-todos-count
1
%li
%a
.dashboard-shortcuts-activity
%span
Activity
%li
%a
%span
Groups
%li
%a
%span
Milestones
%li
%a
.dashboard-shortcuts-issues
%span
Issues
%span
1
%li
%a
.dashboard-shortcuts-merge_requests
%span
Merge Requests
%li
%a
%span
Snippets
%li
%a
%span
Help
%li
%a
%span
Profile Settings
spec/javascripts/project_dashboard_spec.js.es6
deleted
100644 → 0
View file @
8c1b41f1
require('~/sidebar');
(() => {
describe('Project dashboard page', () => {
let $pageWithSidebar = null;
let $sidebarToggle = null;
let sidebar = null;
const fixtureTemplate = 'projects/dashboard.html.raw';
const assertSidebarStateExpanded = (shouldBeExpanded) => {
expect(sidebar.isExpanded).toBe(shouldBeExpanded);
expect($pageWithSidebar.hasClass('page-sidebar-expanded')).toBe(shouldBeExpanded);
};
preloadFixtures(fixtureTemplate);
beforeEach(() => {
loadFixtures(fixtureTemplate);
$pageWithSidebar = $('.page-with-sidebar');
$sidebarToggle = $('.toggle-nav-collapse');
// otherwise instantiating the Sidebar for the second time
// won't do anything, as the Sidebar is a singleton class
gl.Sidebar.singleton = null;
sidebar = new gl.Sidebar();
});
it('can show the sidebar when the toggler is clicked', () => {
assertSidebarStateExpanded(false);
$sidebarToggle.click();
assertSidebarStateExpanded(true);
});
it('should dismiss the sidebar when clone button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const cloneButton = $('.project-clone-holder a.clone-dropdown-btn');
cloneButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when download button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const downloadButton = $('.project-action-button .btn:has(i.fa-download)');
downloadButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when add button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const addButton = $('.project-action-button .btn:has(i.fa-plus)');
addButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when notification button clicked', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
const notifButton = $('.js-notification-toggle-btns .notifications-btn');
notifButton.click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when clicking on the body', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
$('body').click();
assertSidebarStateExpanded(false);
});
it('should dismiss the sidebar when clicking on the project description header', () => {
$sidebarToggle.click();
assertSidebarStateExpanded(true);
$('.project-home-panel').click();
assertSidebarStateExpanded(false);
});
});
})();
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