Commit 1646b81e authored by Fatih Acet's avatar Fatih Acet

Merge branch 'right-sidebar-fixture' into 'master'

Replace static fixture for right_sidebar_spec

## What does this MR do?

Replace `right_sidebar.html.haml` for `right_sidebar_spec.js` by already existing dynamically generated fixture.

## What are the relevant issue numbers?

#24753

See merge request !7687
parents 4d37be0f bc1b305d
---
title: Replace static fixture for right_sidebar_spec
merge_request: 7687
author: winniehell
%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
...@@ -34,9 +34,10 @@ ...@@ -34,9 +34,10 @@
}; };
describe('RightSidebar', function() { describe('RightSidebar', function() {
fixture.preload('right_sidebar.html'); var fixtureName = 'issues/open-issue.html.raw';
fixture.preload(fixtureName);
beforeEach(function() { beforeEach(function() {
fixture.load('right_sidebar.html'); fixture.load(fixtureName);
this.sidebar = new Sidebar; this.sidebar = new Sidebar;
$aside = $('.right-sidebar'); $aside = $('.right-sidebar');
$page = $('.page-with-sidebar'); $page = $('.page-with-sidebar');
...@@ -44,15 +45,12 @@ ...@@ -44,15 +45,12 @@
$toggle = $aside.find('.js-sidebar-toggle'); $toggle = $aside.find('.js-sidebar-toggle');
return $labelsIcon = $aside.find('.sidebar-collapsed-icon'); return $labelsIcon = $aside.find('.sidebar-collapsed-icon');
}); });
it('should expand the sidebar when arrow is clicked', function() { it('should expand/collapse the sidebar when arrow is clicked', function() {
assertSidebarState('expanded');
$toggle.click(); $toggle.click();
return assertSidebarState('expanded'); assertSidebarState('collapsed');
});
it('should collapse the sidebar when arrow is clicked', function() {
$toggle.click(); $toggle.click();
assertSidebarState('expanded'); assertSidebarState('expanded');
$toggle.click();
return assertSidebarState('collapsed');
}); });
it('should float over the page and when sidebar icons clicked', function() { it('should float over the page and when sidebar icons clicked', function() {
$labelsIcon.click(); $labelsIcon.click();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment