summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-12-01 21:03:18 +0000
committerFatih Acet <acetfatih@gmail.com>2016-12-01 21:03:18 +0000
commit1646b81e2a4aa94c82a669b135f875713450eacc (patch)
tree51a6b4d170ca7ce67e015f488df524e7cb478172
parent4d37be0fb874998325d2785e6934fd87a117c806 (diff)
parentbc1b305dcfff3c4818e6e3d1315234db9a555d61 (diff)
downloadgitlab-ce-1646b81e2a4aa94c82a669b135f875713450eacc.tar.gz
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
-rw-r--r--changelogs/unreleased/right-sidebar-fixture.yml4
-rw-r--r--spec/javascripts/fixtures/right_sidebar.html.haml17
-rw-r--r--spec/javascripts/right_sidebar_spec.js14
3 files changed, 10 insertions, 25 deletions
diff --git a/changelogs/unreleased/right-sidebar-fixture.yml b/changelogs/unreleased/right-sidebar-fixture.yml
new file mode 100644
index 00000000000..46a3e459fef
--- /dev/null
+++ b/changelogs/unreleased/right-sidebar-fixture.yml
@@ -0,0 +1,4 @@
+---
+title: Replace static fixture for right_sidebar_spec
+merge_request: 7687
+author: winniehell
diff --git a/spec/javascripts/fixtures/right_sidebar.html.haml b/spec/javascripts/fixtures/right_sidebar.html.haml
deleted file mode 100644
index d259b58f235..00000000000
--- a/spec/javascripts/fixtures/right_sidebar.html.haml
+++ /dev/null
@@ -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
diff --git a/spec/javascripts/right_sidebar_spec.js b/spec/javascripts/right_sidebar_spec.js
index 83ebbd63f3a..0a9bc546144 100644
--- a/spec/javascripts/right_sidebar_spec.js
+++ b/spec/javascripts/right_sidebar_spec.js
@@ -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() {
+ it('should expand/collapse the sidebar when arrow is clicked', function() {
+ assertSidebarState('expanded');
$toggle.click();
- return assertSidebarState('expanded');
- });
- it('should collapse the sidebar when arrow is clicked', function() {
+ assertSidebarState('collapsed');
$toggle.click();
assertSidebarState('expanded');
- $toggle.click();
- return assertSidebarState('collapsed');
});
it('should float over the page and when sidebar icons clicked', function() {
$labelsIcon.click();