Replace static fixture for right_sidebar_spec (!7687)

This commit is contained in:
winniehell 2016-11-23 01:48:14 +01:00
parent 84638de6a3
commit bc1b305dcf
3 changed files with 11 additions and 26 deletions

View file

@ -0,0 +1,4 @@
---
title: Replace static fixture for right_sidebar_spec
merge_request: 7687
author: winniehell

View file

@ -1,17 +0,0 @@
%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
%button.btn.btn-default.issuable-header-btn.pull-right.js-issuable-todo{ type: "button", data: { todo_text: "Add todo", mark_text: "Mark done", issuable_id: "1", issuable_type: "issue", url: "/todos" }}
%span.js-issuable-todo-text
Add todo
%i.fa.fa-spin.fa-spinner.js-issuable-todo-loading.hidden
%form.issuable-context-form
%div.block.labels
%div.sidebar-collapsed-icon
%i.fa.fa-tags
%span 1

View file

@ -34,9 +34,10 @@
};
describe('RightSidebar', function() {
fixture.preload('right_sidebar.html');
var fixtureName = 'issues/open-issue.html.raw';
fixture.preload(fixtureName);
beforeEach(function() {
fixture.load('right_sidebar.html');
fixture.load(fixtureName);
this.sidebar = new Sidebar;
$aside = $('.right-sidebar');
$page = $('.page-with-sidebar');
@ -44,15 +45,12 @@
$toggle = $aside.find('.js-sidebar-toggle');
return $labelsIcon = $aside.find('.sidebar-collapsed-icon');
});
it('should expand the sidebar when arrow is clicked', function() {
$toggle.click();
return assertSidebarState('expanded');
});
it('should collapse the sidebar when arrow is clicked', function() {
$toggle.click();
it('should expand/collapse the sidebar when arrow is clicked', function() {
assertSidebarState('expanded');
$toggle.click();
return assertSidebarState('collapsed');
assertSidebarState('collapsed');
$toggle.click();
assertSidebarState('expanded');
});
it('should float over the page and when sidebar icons clicked', function() {
$labelsIcon.click();