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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
7a2a9bb4
Commit
7a2a9bb4
authored
Dec 30, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace Teaspoon fixture methods with jasmine-jquery methods to reduce dependency on Teaspoon
parent
10d483ea
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
108 additions
and
97 deletions
+108
-97
spec/javascripts/.eslintrc
spec/javascripts/.eslintrc
+18
-5
spec/javascripts/abuse_reports_spec.js.es6
spec/javascripts/abuse_reports_spec.js.es6
+2
-2
spec/javascripts/activities_spec.js.es6
spec/javascripts/activities_spec.js.es6
+1
-1
spec/javascripts/awards_handler_spec.js
spec/javascripts/awards_handler_spec.js
+2
-2
spec/javascripts/behaviors/autosize_spec.js
spec/javascripts/behaviors/autosize_spec.js
+1
-1
spec/javascripts/behaviors/quick_submit_spec.js
spec/javascripts/behaviors/quick_submit_spec.js
+2
-2
spec/javascripts/behaviors/requires_input_spec.js
spec/javascripts/behaviors/requires_input_spec.js
+2
-2
spec/javascripts/bootstrap_linked_tabs_spec.js.es6
spec/javascripts/bootstrap_linked_tabs_spec.js.es6
+2
-2
spec/javascripts/build_spec.js.es6
spec/javascripts/build_spec.js.es6
+2
-2
spec/javascripts/dashboard_spec.js.es6
spec/javascripts/dashboard_spec.js.es6
+2
-2
spec/javascripts/environments/environment_actions_spec.js.es6
.../javascripts/environments/environment_actions_spec.js.es6
+2
-2
spec/javascripts/environments/environment_external_url_spec.js.es6
...scripts/environments/environment_external_url_spec.js.es6
+2
-2
spec/javascripts/environments/environment_item_spec.js.es6
spec/javascripts/environments/environment_item_spec.js.es6
+2
-2
spec/javascripts/environments/environment_rollback_spec.js.es6
...javascripts/environments/environment_rollback_spec.js.es6
+2
-2
spec/javascripts/environments/environment_stop_spec.js.es6
spec/javascripts/environments/environment_stop_spec.js.es6
+2
-2
spec/javascripts/extensions/jquery_spec.js
spec/javascripts/extensions/jquery_spec.js
+2
-2
spec/javascripts/gl_dropdown_spec.js.es6
spec/javascripts/gl_dropdown_spec.js.es6
+3
-4
spec/javascripts/gl_field_errors_spec.js.es6
spec/javascripts/gl_field_errors_spec.js.es6
+2
-2
spec/javascripts/header_spec.js
spec/javascripts/header_spec.js
+2
-2
spec/javascripts/issuable_spec.js.es6
spec/javascripts/issuable_spec.js.es6
+3
-3
spec/javascripts/issue_spec.js
spec/javascripts/issue_spec.js
+6
-6
spec/javascripts/labels_issue_sidebar_spec.js.es6
spec/javascripts/labels_issue_sidebar_spec.js.es6
+2
-2
spec/javascripts/line_highlighter_spec.js
spec/javascripts/line_highlighter_spec.js
+2
-2
spec/javascripts/merge_request_spec.js
spec/javascripts/merge_request_spec.js
+2
-2
spec/javascripts/merge_request_tabs_spec.js
spec/javascripts/merge_request_tabs_spec.js
+2
-2
spec/javascripts/mini_pipeline_graph_dropdown_spec.js.es6
spec/javascripts/mini_pipeline_graph_dropdown_spec.js.es6
+2
-2
spec/javascripts/new_branch_spec.js
spec/javascripts/new_branch_spec.js
+2
-2
spec/javascripts/notes_spec.js
spec/javascripts/notes_spec.js
+2
-2
spec/javascripts/pipelines_spec.js.es6
spec/javascripts/pipelines_spec.js.es6
+2
-2
spec/javascripts/project_title_spec.js
spec/javascripts/project_title_spec.js
+3
-4
spec/javascripts/right_sidebar_spec.js
spec/javascripts/right_sidebar_spec.js
+3
-3
spec/javascripts/search_autocomplete_spec.js
spec/javascripts/search_autocomplete_spec.js
+2
-2
spec/javascripts/shortcuts_issuable_spec.js
spec/javascripts/shortcuts_issuable_spec.js
+2
-2
spec/javascripts/signin_tabs_memoizer_spec.js.es6
spec/javascripts/signin_tabs_memoizer_spec.js.es6
+2
-2
spec/javascripts/smart_interval_spec.js.es6
spec/javascripts/smart_interval_spec.js.es6
+1
-1
spec/javascripts/spec_helper.js
spec/javascripts/spec_helper.js
+5
-5
spec/javascripts/syntax_highlight_spec.js
spec/javascripts/syntax_highlight_spec.js
+3
-3
spec/javascripts/u2f/authenticate_spec.js
spec/javascripts/u2f/authenticate_spec.js
+2
-2
spec/javascripts/u2f/register_spec.js
spec/javascripts/u2f/register_spec.js
+2
-2
spec/javascripts/vue_common_components/commit_spec.js.es6
spec/javascripts/vue_common_components/commit_spec.js.es6
+3
-3
spec/javascripts/zen_mode_spec.js
spec/javascripts/zen_mode_spec.js
+2
-2
No files found.
spec/javascripts/.eslintrc
View file @
7a2a9bb4
{
"plugins": ["jasmine"],
"env": {
"jasmine": true
},
"extends": "plugin:jasmine/recommended",
"globals": {
"appendLoadFixtures": false,
"appendLoadStyleFixtures": false,
"appendSetFixtures": false,
"appendSetStyleFixtures": false,
"getJSONFixture": false,
"loadFixtures": false,
"loadJSONFixtures": false,
"loadStyleFixtures": false,
"preloadFixtures": false,
"preloadStyleFixtures": false,
"readFixtures": false,
"sandbox": false,
"setFixtures": false,
"setStyleFixtures": false,
"spyOnEvent": false
},
"plugins": ["jasmine"],
"rules": {
"prefer-arrow-callback": 0,
"func-names": 0
},
"globals": {
"fixture": false,
"spyOnEvent": false
}
}
spec/javascripts/abuse_reports_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -13,10 +13,10 @@
(index, element) => element.innerText.indexOf(searchText) > -1,
).first();
fixture.preload
(FIXTURE);
preloadFixtures
(FIXTURE);
beforeEach(function () {
fixture.load
(FIXTURE);
loadFixtures
(FIXTURE);
this.abuseReports = new global.AbuseReports();
messages = $('.abuse-reports .message');
});
...
...
spec/javascripts/activities_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -35,7 +35,7 @@
describe('Activities', () => {
beforeEach(() => {
fixture.load
(fixtureTemplate);
loadFixtures
(fixtureTemplate);
new gl.Activities();
});
...
...
spec/javascripts/awards_handler_spec.js
View file @
7a2a9bb4
...
...
@@ -34,9 +34,9 @@
};
describe
(
'
AwardsHandler
'
,
function
()
{
fixture
.
preload
(
'
issues/open-issue.html.raw
'
);
preloadFixtures
(
'
issues/open-issue.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
issues/open-issue.html.raw
'
);
loadFixtures
(
'
issues/open-issue.html.raw
'
);
awardsHandler
=
new
AwardsHandler
;
spyOn
(
awardsHandler
,
'
postEmoji
'
).
and
.
callFake
((
function
(
_this
)
{
return
function
(
url
,
emoji
,
cb
)
{
...
...
spec/javascripts/behaviors/autosize_spec.js
View file @
7a2a9bb4
...
...
@@ -6,7 +6,7 @@
describe
(
'
Autosize behavior
'
,
function
()
{
var
load
;
beforeEach
(
function
()
{
return
fixture
.
set
(
'
<textarea class="js-autosize" style="resize: vertical"></textarea>
'
);
return
setFixtures
(
'
<textarea class="js-autosize" style="resize: vertical"></textarea>
'
);
});
it
(
'
does not overwrite the resize property
'
,
function
()
{
load
();
...
...
spec/javascripts/behaviors/quick_submit_spec.js
View file @
7a2a9bb4
...
...
@@ -5,9 +5,9 @@
(
function
()
{
describe
(
'
Quick Submit behavior
'
,
function
()
{
var
keydownEvent
;
fixture
.
preload
(
'
static/behaviors/quick_submit.html.raw
'
);
preloadFixtures
(
'
static/behaviors/quick_submit.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
static/behaviors/quick_submit.html.raw
'
);
loadFixtures
(
'
static/behaviors/quick_submit.html.raw
'
);
$
(
'
form
'
).
submit
(
function
(
e
)
{
// Prevent a form submit from moving us off the testing page
return
e
.
preventDefault
();
...
...
spec/javascripts/behaviors/requires_input_spec.js
View file @
7a2a9bb4
...
...
@@ -4,9 +4,9 @@
(
function
()
{
describe
(
'
requiresInput
'
,
function
()
{
fixture
.
preload
(
'
static/behaviors/requires_input.html.raw
'
);
preloadFixtures
(
'
static/behaviors/requires_input.html.raw
'
);
beforeEach
(
function
()
{
return
fixture
.
load
(
'
static/behaviors/requires_input.html.raw
'
);
return
loadFixtures
(
'
static/behaviors/requires_input.html.raw
'
);
});
it
(
'
disables submit when any field is required
'
,
function
()
{
$
(
'
.js-requires-input
'
).
requiresInput
();
...
...
spec/javascripts/bootstrap_linked_tabs_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -2,10 +2,10 @@
(() => {
describe('Linked Tabs', () => {
fixture.preload
('static/linked_tabs.html.raw');
preloadFixtures
('static/linked_tabs.html.raw');
beforeEach(() => {
fixture.load
('static/linked_tabs.html.raw');
loadFixtures
('static/linked_tabs.html.raw');
});
describe('when is initialized', () => {
...
...
spec/javascripts/build_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -17,10 +17,10 @@ describe('Build', () => {
offset: BUILD_TRACE.length, n_open_tags: 0, fg_color: null, bg_color: null, style_mask: 0,
}));
fixture.preload
('builds/build-with-artifacts.html.raw');
preloadFixtures
('builds/build-with-artifacts.html.raw');
beforeEach(() => {
fixture.load
('builds/build-with-artifacts.html.raw');
loadFixtures
('builds/build-with-artifacts.html.raw');
spyOn($, 'ajax');
});
...
...
spec/javascripts/dashboard_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -17,9 +17,9 @@
$(document).trigger('todo:toggle', newCount);
}
fixture.preload
(fixtureTemplate);
preloadFixtures
(fixtureTemplate);
beforeEach(() => {
fixture.load
(fixtureTemplate);
loadFixtures
(fixtureTemplate);
new global.Sidebar();
});
...
...
spec/javascripts/environments/environment_actions_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -2,10 +2,10 @@
//= require environments/components/environment_actions
describe('Actions Component', () => {
fixture.preload
('static/environments/element.html.raw');
preloadFixtures
('static/environments/element.html.raw');
beforeEach(() => {
fixture.load
('static/environments/element.html.raw');
loadFixtures
('static/environments/element.html.raw');
});
it('should render a dropdown with the provided actions', () => {
...
...
spec/javascripts/environments/environment_external_url_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -2,9 +2,9 @@
//= require environments/components/environment_external_url
describe('External URL Component', () => {
fixture.preload
('static/environments/element.html.raw');
preloadFixtures
('static/environments/element.html.raw');
beforeEach(() => {
fixture.load
('static/environments/element.html.raw');
loadFixtures
('static/environments/element.html.raw');
});
it('should link to the provided externalUrl prop', () => {
...
...
spec/javascripts/environments/environment_item_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -3,9 +3,9 @@
//= require environments/components/environment_item
describe('Environment item', () => {
fixture.preload
('static/environments/table.html.raw');
preloadFixtures
('static/environments/table.html.raw');
beforeEach(() => {
fixture.load
('static/environments/table.html.raw');
loadFixtures
('static/environments/table.html.raw');
});
describe('When item is folder', () => {
...
...
spec/javascripts/environments/environment_rollback_spec.js.es6
View file @
7a2a9bb4
//= require vue
//= require environments/components/environment_rollback
describe('Rollback Component', () => {
fixture.preload
('static/environments/element.html.raw');
preloadFixtures
('static/environments/element.html.raw');
const retryURL = 'https://gitlab.com/retry';
beforeEach(() => {
fixture.load
('static/environments/element.html.raw');
loadFixtures
('static/environments/element.html.raw');
});
it('Should link to the provided retryUrl', () => {
...
...
spec/javascripts/environments/environment_stop_spec.js.es6
View file @
7a2a9bb4
//= require vue
//= require environments/components/environment_stop
describe('Stop Component', () => {
fixture.preload
('static/environments/element.html.raw');
preloadFixtures
('static/environments/element.html.raw');
let stopURL;
let component;
beforeEach(() => {
fixture.load
('static/environments/element.html.raw');
loadFixtures
('static/environments/element.html.raw');
stopURL = '/stop';
component = new window.gl.environmentsList.StopComponent({
...
...
spec/javascripts/extensions/jquery_spec.js
View file @
7a2a9bb4
...
...
@@ -6,7 +6,7 @@
describe
(
'
jQuery extensions
'
,
function
()
{
describe
(
'
disable
'
,
function
()
{
beforeEach
(
function
()
{
return
fixture
.
set
(
'
<input type="text" />
'
);
return
setFixtures
(
'
<input type="text" />
'
);
});
it
(
'
adds the disabled attribute
'
,
function
()
{
var
$input
;
...
...
@@ -23,7 +23,7 @@
});
return
describe
(
'
enable
'
,
function
()
{
beforeEach
(
function
()
{
return
fixture
.
set
(
'
<input type="text" disabled="disabled" class="disabled" />
'
);
return
setFixtures
(
'
<input type="text" disabled="disabled" class="disabled" />
'
);
});
it
(
'
removes the disabled attribute
'
,
function
()
{
var
$input
;
...
...
spec/javascripts/gl_dropdown_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -43,8 +43,7 @@
}
describe('Dropdown', function describeDropdown() {
fixture.preload('static/gl_dropdown.html.raw');
fixture.preload('projects.json');
preloadFixtures('static/gl_dropdown.html.raw');
function initDropDown(hasRemote, isFilterable) {
this.dropdownButtonElement = $('#js-project-dropdown', this.dropdownContainerElement).glDropdown({
...
...
@@ -61,10 +60,10 @@
}
beforeEach(() => {
fixture.load
('static/gl_dropdown.html.raw');
loadFixtures
('static/gl_dropdown.html.raw');
this.dropdownContainerElement = $('.dropdown.inline');
this.$dropdownMenuElement = $('.dropdown-menu', this.dropdownContainerElement);
this.projectsData =
fixture.load('projects.json')[0]
;
this.projectsData =
getJSONFixture('projects.json')
;
});
afterEach(() => {
...
...
spec/javascripts/gl_field_errors_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -4,11 +4,11 @@
//= require gl_field_errors
((global) => {
fixture.preload
('static/gl_field_errors.html.raw');
preloadFixtures
('static/gl_field_errors.html.raw');
describe('GL Style Field Errors', function() {
beforeEach(function() {
fixture.load
('static/gl_field_errors.html.raw');
loadFixtures
('static/gl_field_errors.html.raw');
const $form = this.$form = $('form.gl-show-field-errors');
this.fieldErrors = new global.GlFieldErrors($form);
});
...
...
spec/javascripts/header_spec.js
View file @
7a2a9bb4
...
...
@@ -17,9 +17,9 @@
$
(
document
).
trigger
(
'
todo:toggle
'
,
newCount
);
}
fixture
.
preload
(
fixtureTemplate
);
preloadFixtures
(
fixtureTemplate
);
beforeEach
(
function
()
{
fixture
.
load
(
fixtureTemplate
);
loadFixtures
(
fixtureTemplate
);
});
it
(
'
should update todos-pending-count after receiving the todo:toggle event
'
,
function
()
{
...
...
spec/javascripts/issuable_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -21,10 +21,10 @@
}
describe('Issuable', () => {
fixture.preload
('static/issuable_filter.html.raw');
preloadFixtures
('static/issuable_filter.html.raw');
beforeEach(() => {
fixture.load
('static/issuable_filter.html.raw');
loadFixtures
('static/issuable_filter.html.raw');
Issuable.init();
});
...
...
@@ -37,7 +37,7 @@
beforeEach(() => {
$filtersForm = $('.js-filter-form');
fixture.load
('static/issuable_filter.html.raw');
loadFixtures
('static/issuable_filter.html.raw');
resetForm($filtersForm);
});
...
...
spec/javascripts/issue_spec.js
View file @
7a2a9bb4
...
...
@@ -8,9 +8,9 @@
var
INVALID_URL
=
'
http://goesnowhere.nothing/whereami
'
;
var
$boxClosed
,
$boxOpen
,
$btnClose
,
$btnReopen
;
fixture
.
preload
(
'
issues/closed-issue.html.raw
'
);
fixture
.
preload
(
'
issues/issue-with-task-list.html.raw
'
);
fixture
.
preload
(
'
issues/open-issue.html.raw
'
);
preloadFixtures
(
'
issues/closed-issue.html.raw
'
);
preloadFixtures
(
'
issues/issue-with-task-list.html.raw
'
);
preloadFixtures
(
'
issues/open-issue.html.raw
'
);
function
expectErrorMessage
()
{
var
$flashMessage
=
$
(
'
div.flash-alert
'
);
...
...
@@ -61,8 +61,8 @@
describe
(
'
Issue
'
,
function
()
{
describe
(
'
task lists
'
,
function
()
{
fixture
.
load
(
'
issues/issue-with-task-list.html.raw
'
);
beforeEach
(
function
()
{
loadFixtures
(
'
issues/issue-with-task-list.html.raw
'
);
this
.
issue
=
new
Issue
();
});
...
...
@@ -86,7 +86,7 @@
describe
(
'
close issue
'
,
function
()
{
beforeEach
(
function
()
{
fixture
.
load
(
'
issues/open-issue.html.raw
'
);
loadFixtures
(
'
issues/open-issue.html.raw
'
);
findElements
();
this
.
issue
=
new
Issue
();
...
...
@@ -140,7 +140,7 @@
describe
(
'
reopen issue
'
,
function
()
{
beforeEach
(
function
()
{
fixture
.
load
(
'
issues/closed-issue.html.raw
'
);
loadFixtures
(
'
issues/closed-issue.html.raw
'
);
findElements
();
this
.
issue
=
new
Issue
();
...
...
spec/javascripts/labels_issue_sidebar_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -17,10 +17,10 @@
(() => {
let saveLabelCount = 0;
describe('Issue dropdown sidebar', () => {
fixture.preload
('static/issue_sidebar_label.html.raw');
preloadFixtures
('static/issue_sidebar_label.html.raw');
beforeEach(() => {
fixture.load
('static/issue_sidebar_label.html.raw');
loadFixtures
('static/issue_sidebar_label.html.raw');
new IssuableContext('{"id":1,"name":"Administrator","username":"root"}');
new LabelsSelect();
...
...
spec/javascripts/line_highlighter_spec.js
View file @
7a2a9bb4
...
...
@@ -6,7 +6,7 @@
(
function
()
{
describe
(
'
LineHighlighter
'
,
function
()
{
var
clickLine
;
fixture
.
preload
(
'
static/line_highlighter.html.raw
'
);
preloadFixtures
(
'
static/line_highlighter.html.raw
'
);
clickLine
=
function
(
number
,
eventData
)
{
var
e
;
if
(
eventData
==
null
)
{
...
...
@@ -20,7 +20,7 @@
}
};
beforeEach
(
function
()
{
fixture
.
load
(
'
static/line_highlighter.html.raw
'
);
loadFixtures
(
'
static/line_highlighter.html.raw
'
);
this
[
"
class
"
]
=
new
LineHighlighter
();
this
.
css
=
this
[
"
class
"
].
highlightClass
;
return
this
.
spies
=
{
...
...
spec/javascripts/merge_request_spec.js
View file @
7a2a9bb4
...
...
@@ -6,9 +6,9 @@
(
function
()
{
describe
(
'
MergeRequest
'
,
function
()
{
return
describe
(
'
task lists
'
,
function
()
{
fixture
.
preload
(
'
static/merge_requests_show.html.raw
'
);
preloadFixtures
(
'
static/merge_requests_show.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
static/merge_requests_show.html.raw
'
);
loadFixtures
(
'
static/merge_requests_show.html.raw
'
);
return
this
.
merge
=
new
MergeRequest
();
});
it
(
'
modifies the Markdown field
'
,
function
()
{
...
...
spec/javascripts/merge_request_tabs_spec.js
View file @
7a2a9bb4
...
...
@@ -16,7 +16,7 @@
};
$
.
extend
(
stubLocation
,
defaults
,
stubs
||
{});
};
fixture
.
preload
(
'
static/merge_request_tabs.html.raw
'
);
preloadFixtures
(
'
static/merge_request_tabs.html.raw
'
);
beforeEach
(
function
()
{
this
.
class
=
new
gl
.
MergeRequestTabs
({
stubLocation
:
stubLocation
});
...
...
@@ -30,7 +30,7 @@
describe
(
'
#activateTab
'
,
function
()
{
beforeEach
(
function
()
{
spyOn
(
$
,
'
ajax
'
).
and
.
callFake
(
function
()
{});
fixture
.
load
(
'
static/merge_request_tabs.html.raw
'
);
loadFixtures
(
'
static/merge_request_tabs.html.raw
'
);
this
.
subject
=
this
.
class
.
activateTab
;
});
it
(
'
shows the first tab when action is show
'
,
function
()
{
...
...
spec/javascripts/mini_pipeline_graph_dropdown_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -5,10 +5,10 @@
(() => {
describe('Mini Pipeline Graph Dropdown', () => {
fixture.preload
('static/mini_dropdown_graph.html.raw');
preloadFixtures
('static/mini_dropdown_graph.html.raw');
beforeEach(() => {
fixture.load
('static/mini_dropdown_graph.html.raw');
loadFixtures
('static/mini_dropdown_graph.html.raw');
});
describe('When is initialized', () => {
...
...
spec/javascripts/new_branch_spec.js
View file @
7a2a9bb4
...
...
@@ -8,7 +8,7 @@
describe
(
'
Branch
'
,
function
()
{
return
describe
(
'
create a new branch
'
,
function
()
{
var
expectToHaveError
,
fillNameWith
;
fixture
.
preload
(
'
static/new_branch.html.raw
'
);
preloadFixtures
(
'
static/new_branch.html.raw
'
);
fillNameWith
=
function
(
value
)
{
return
$
(
'
.js-branch-name
'
).
val
(
value
).
trigger
(
'
blur
'
);
};
...
...
@@ -16,7 +16,7 @@
return
expect
(
$
(
'
.js-branch-name-error span
'
).
text
()).
toEqual
(
error
);
};
beforeEach
(
function
()
{
fixture
.
load
(
'
static/new_branch.html.raw
'
);
loadFixtures
(
'
static/new_branch.html.raw
'
);
$
(
'
form
'
).
on
(
'
submit
'
,
function
(
e
)
{
return
e
.
preventDefault
();
});
...
...
spec/javascripts/notes_spec.js
View file @
7a2a9bb4
...
...
@@ -13,10 +13,10 @@
describe
(
'
Notes
'
,
function
()
{
var
commentsTemplate
=
'
issues/issue_with_comment.html.raw
'
;
fixture
.
preload
(
commentsTemplate
);
preloadFixtures
(
commentsTemplate
);
beforeEach
(
function
()
{
fixture
.
load
(
commentsTemplate
);
loadFixtures
(
commentsTemplate
);
gl
.
utils
.
disableButtonIfEmptyField
=
_
.
noop
;
window
.
project_uploads_path
=
'
http://test.host/uploads
'
;
});
...
...
spec/javascripts/pipelines_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -2,10 +2,10 @@
(() => {
describe('Pipelines', () => {
fixture.preload
('static/pipeline_graph.html.raw');
preloadFixtures
('static/pipeline_graph.html.raw');
beforeEach(() => {
fixture.load
('static/pipeline_graph.html.raw');
loadFixtures
('static/pipeline_graph.html.raw');
});
it('should be defined', () => {
...
...
spec/javascripts/project_title_spec.js
View file @
7a2a9bb4
...
...
@@ -16,10 +16,9 @@
window
.
gon
.
api_version
=
'
v3
'
;
describe
(
'
Project Title
'
,
function
()
{
fixture
.
preload
(
'
static/project_title.html.raw
'
);
fixture
.
preload
(
'
projects.json
'
);
preloadFixtures
(
'
static/project_title.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
static/project_title.html.raw
'
);
loadFixtures
(
'
static/project_title.html.raw
'
);
return
this
.
project
=
new
Project
();
});
return
describe
(
'
project list
'
,
function
()
{
...
...
@@ -34,7 +33,7 @@
beforeEach
((
function
(
_this
)
{
return
function
()
{
_this
.
projects_data
=
fixture
.
load
(
'
projects.json
'
)[
0
]
;
_this
.
projects_data
=
getJSONFixture
(
'
projects.json
'
)
;
return
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
(
fakeAjaxResponse
.
bind
(
_this
));
};
})(
this
));
...
...
spec/javascripts/right_sidebar_spec.js
View file @
7a2a9bb4
...
...
@@ -36,9 +36,9 @@
describe
(
'
RightSidebar
'
,
function
()
{
var
fixtureName
=
'
issues/open-issue.html.raw
'
;
fixture
.
preload
(
fixtureName
);
preloadFixtures
(
fixtureName
);
beforeEach
(
function
()
{
fixture
.
load
(
fixtureName
);
loadFixtures
(
fixtureName
);
this
.
sidebar
=
new
Sidebar
;
$aside
=
$
(
'
.right-sidebar
'
);
$page
=
$
(
'
.page-with-sidebar
'
);
...
...
@@ -67,7 +67,7 @@
it
(
'
should broadcast todo:toggle event when add todo clicked
'
,
function
()
{
spyOn
(
jQuery
,
'
ajax
'
).
and
.
callFake
(
function
()
{
var
d
=
$
.
Deferred
();
var
response
=
fixture
.
load
(
'
todos.json
'
);
var
response
=
getJSONFixture
(
'
todos.json
'
);
d
.
resolve
(
response
);
return
d
.
promise
();
});
...
...
spec/javascripts/search_autocomplete_spec.js
View file @
7a2a9bb4
...
...
@@ -112,9 +112,9 @@
};
describe
(
'
Search autocomplete dropdown
'
,
function
()
{
fixture
.
preload
(
'
static/search_autocomplete.html.raw
'
);
preloadFixtures
(
'
static/search_autocomplete.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
static/search_autocomplete.html.raw
'
);
loadFixtures
(
'
static/search_autocomplete.html.raw
'
);
return
widget
=
new
gl
.
SearchAutocomplete
;
});
it
(
'
should show Dashboard specific dropdown menu
'
,
function
()
{
...
...
spec/javascripts/shortcuts_issuable_spec.js
View file @
7a2a9bb4
...
...
@@ -6,9 +6,9 @@
(
function
()
{
describe
(
'
ShortcutsIssuable
'
,
function
()
{
var
fixtureName
=
'
issues/open-issue.html.raw
'
;
fixture
.
preload
(
fixtureName
);
preloadFixtures
(
fixtureName
);
beforeEach
(
function
()
{
fixture
.
load
(
fixtureName
);
loadFixtures
(
fixtureName
);
document
.
querySelector
(
'
.js-new-note-form
'
).
classList
.
add
(
'
js-main-target-form
'
);
return
this
.
shortcut
=
new
ShortcutsIssuable
();
});
...
...
spec/javascripts/signin_tabs_memoizer_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -15,10 +15,10 @@
return memo;
}
fixture.preload
(fixtureTemplate);
preloadFixtures
(fixtureTemplate);
beforeEach(() => {
fixture.load
(fixtureTemplate);
loadFixtures
(fixtureTemplate);
});
it('does nothing if no tab was previously selected', () => {
...
...
spec/javascripts/smart_interval_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -103,7 +103,7 @@
describe('DOM Events', function () {
beforeEach(function () {
// This ensures DOM and DOM events are initialized for these specs.
fixture.set
('<div></div>');
setFixtures
('<div></div>');
this.smartInterval = createDefaultSmartInterval();
});
...
...
spec/javascripts/spec_helper.js
View file @
7a2a9bb4
...
...
@@ -37,12 +37,12 @@
// file as a manifest.
// For more information: http://github.com/modeset/teaspoon
(
function
()
{
}).
call
(
this
);
// set our fixtures path
jasmine
.
getFixtures
().
fixturesPath
=
'
/teaspoon/fixtures
'
;
jasmine
.
getJSONFixtures
().
fixturesPath
=
'
/teaspoon/fixtures
'
;
// defined in ActionDispatch::TestRequest
// see https://github.com/rails/rails/blob/v4.2.7.1/actionpack/lib/action_dispatch/testing/test_request.rb#L7
window
.
gl
=
window
.
gl
||
{};
gl
.
TEST_HOST
=
'
http://test.host
'
;
window
.
gl
.
TEST_HOST
=
'
http://test.host
'
;
window
.
gon
=
window
.
gon
||
{};
spec/javascripts/syntax_highlight_spec.js
View file @
7a2a9bb4
...
...
@@ -13,7 +13,7 @@
};
describe
(
'
on a js-syntax-highlight element
'
,
function
()
{
beforeEach
(
function
()
{
return
fixture
.
set
(
'
<div class="js-syntax-highlight"></div>
'
);
return
setFixtures
(
'
<div class="js-syntax-highlight"></div>
'
);
});
return
it
(
'
applies syntax highlighting
'
,
function
()
{
stubUserColorScheme
(
'
monokai
'
);
...
...
@@ -23,7 +23,7 @@
});
return
describe
(
'
on a parent element
'
,
function
()
{
beforeEach
(
function
()
{
return
fixture
.
set
(
"
<div class=
\"
parent
\"
>
\n
<div class=
\"
js-syntax-highlight
\"
></div>
\n
<div class=
\"
foo
\"
></div>
\n
<div class=
\"
js-syntax-highlight
\"
></div>
\n
</div>
"
);
return
setFixtures
(
"
<div class=
\"
parent
\"
>
\n
<div class=
\"
js-syntax-highlight
\"
></div>
\n
<div class=
\"
foo
\"
></div>
\n
<div class=
\"
js-syntax-highlight
\"
></div>
\n
</div>
"
);
});
it
(
'
applies highlighting to all applicable children
'
,
function
()
{
stubUserColorScheme
(
'
monokai
'
);
...
...
@@ -33,7 +33,7 @@
});
return
it
(
'
prevents an infinite loop when no matches exist
'
,
function
()
{
var
highlight
;
fixture
.
set
(
'
<div></div>
'
);
setFixtures
(
'
<div></div>
'
);
highlight
=
function
()
{
return
$
(
'
div
'
).
syntaxHighlight
();
};
...
...
spec/javascripts/u2f/authenticate_spec.js
View file @
7a2a9bb4
...
...
@@ -10,10 +10,10 @@
(
function
()
{
describe
(
'
U2FAuthenticate
'
,
function
()
{
fixture
.
preload
(
'
u2f/authenticate.html.raw
'
);
preloadFixtures
(
'
u2f/authenticate.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
u2f/authenticate.html.raw
'
);
loadFixtures
(
'
u2f/authenticate.html.raw
'
);
this
.
u2fDevice
=
new
MockU2FDevice
;
this
.
container
=
$
(
"
#js-authenticate-u2f
"
);
this
.
component
=
new
window
.
gl
.
U2FAuthenticate
(
...
...
spec/javascripts/u2f/register_spec.js
View file @
7a2a9bb4
...
...
@@ -10,10 +10,10 @@
(
function
()
{
describe
(
'
U2FRegister
'
,
function
()
{
fixture
.
preload
(
'
u2f/register.html.raw
'
);
preloadFixtures
(
'
u2f/register.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
u2f/register.html.raw
'
);
loadFixtures
(
'
u2f/register.html.raw
'
);
this
.
u2fDevice
=
new
MockU2FDevice
;
this
.
container
=
$
(
"
#js-register-u2f
"
);
this
.
component
=
new
U2FRegister
(
this
.
container
,
$
(
"
#js-register-u2f-templates
"
),
{},
"
token
"
);
...
...
spec/javascripts/vue_common_components/commit_spec.js.es6
View file @
7a2a9bb4
...
...
@@ -5,7 +5,7 @@ describe('Commit component', () => {
let component;
it('should render a code-fork icon if it does not represent a tag', () => {
fixture.set
('<div class="test-commit-container"></div>');
setFixtures
('<div class="test-commit-container"></div>');
component = new window.gl.CommitComponent({
el: document.querySelector('.test-commit-container'),
propsData: {
...
...
@@ -30,7 +30,7 @@ describe('Commit component', () => {
describe('Given all the props', () => {
beforeEach(() => {
fixture.set
('<div class="test-commit-container"></div>');
setFixtures
('<div class="test-commit-container"></div>');
props = {
tag: true,
...
...
@@ -105,7 +105,7 @@ describe('Commit component', () => {
describe('When commit title is not provided', () => {
it('should render default message', () => {
fixture.set
('<div class="test-commit-container"></div>');
setFixtures
('<div class="test-commit-container"></div>');
props = {
tag: false,
commitRef: {
...
...
spec/javascripts/zen_mode_spec.js
View file @
7a2a9bb4
...
...
@@ -10,9 +10,9 @@
describe
(
'
ZenMode
'
,
function
()
{
var
fixtureName
=
'
issues/open-issue.html.raw
'
;
fixture
.
preload
(
fixtureName
);
preloadFixtures
(
fixtureName
);
beforeEach
(
function
()
{
fixture
.
load
(
fixtureName
);
loadFixtures
(
fixtureName
);
spyOn
(
Dropzone
,
'
forElement
'
).
and
.
callFake
(
function
()
{
return
{
enable
:
function
()
{
...
...
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