Commit 7dd7ffc1 authored by Clement Ho's avatar Clement Ho

Merge branch 'dynamic-project-title-fixture' into 'master'

Replace static fixture for project_title_spec.js

See merge request !9175
parents 953c2547 6f1d8201
---
title: Replace static fixture for project_title_spec.js
merge_request: 9175
author: winniehell
.header-content
%h1.title
%a
GitLab Org
%a.project-item-select-holder{href: "/gitlab-org/gitlab-test"}
GitLab Test
%i.fa.chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle{ "data-toggle" => "dropdown", "data-target" => ".header-content", "data-order-by" => "last_activity_at" }
.js-dropdown-menu-projects
.dropdown-menu.dropdown-select.dropdown-menu-projects
.dropdown-title
%span Go to a project
%button.dropdown-title-button.dropdown-menu-close{"aria-label" => "Close", type: "button"}
%i.fa.fa-times.dropdown-menu-close-icon
.dropdown-input
%input.dropdown-input-field{id: "", placeholder: "Search your projects", type: "search", value: ""}
%i.fa.fa-search.dropdown-input-search
%i.fa.fa-times.dropdown-input-clear.js-dropdown-input-clear{role: "button"}
.dropdown-content
.dropdown-loading
%i.fa.fa-spinner.fa-spin
...@@ -10,11 +10,11 @@ require('~/project'); ...@@ -10,11 +10,11 @@ require('~/project');
(function() { (function() {
describe('Project Title', function() { describe('Project Title', function() {
preloadFixtures('static/project_title.html.raw'); preloadFixtures('issues/open-issue.html.raw');
loadJSONFixtures('projects.json'); loadJSONFixtures('projects.json');
beforeEach(function() { beforeEach(function() {
loadFixtures('static/project_title.html.raw'); loadFixtures('issues/open-issue.html.raw');
window.gon = {}; window.gon = {};
window.gon.api_version = 'v3'; window.gon.api_version = 'v3';
...@@ -38,15 +38,12 @@ require('~/project'); ...@@ -38,15 +38,12 @@ require('~/project');
return spyOn(jQuery, 'ajax').and.callFake(fakeAjaxResponse.bind(_this)); return spyOn(jQuery, 'ajax').and.callFake(fakeAjaxResponse.bind(_this));
}; };
})(this)); })(this));
it('to show on toggle click', (function(_this) { it('toggles dropdown', function() {
return function() { var menu = $('.js-dropdown-menu-projects');
$('.js-projects-dropdown-toggle').click(); $('.js-projects-dropdown-toggle').click();
return expect($('.header-content').hasClass('open')).toBe(true); expect(menu).toHaveClass('open');
}; menu.find('.dropdown-menu-close-icon').click();
})(this)); expect(menu).not.toHaveClass('open');
return it('hide dropdown', function() {
$(".dropdown-menu-close-icon").click();
return expect($('.header-content').hasClass('open')).toBe(false);
}); });
}); });
......
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