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
Jérome Perrin
gitlab-ce
Commits
e7b5945c
Commit
e7b5945c
authored
Jan 10, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve all semi and no-extra-semi eslint violations
parent
9e4d0491
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
285 additions
and
285 deletions
+285
-285
app/assets/javascripts/boards/components/board_blank_state.js.es6
...ts/javascripts/boards/components/board_blank_state.js.es6
+2
-2
app/assets/javascripts/boards/mixins/sortable_default_options.js.es6
...javascripts/boards/mixins/sortable_default_options.js.es6
+2
-2
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+1
-1
app/assets/javascripts/boards/stores/boards_store.js.es6
app/assets/javascripts/boards/stores/boards_store.js.es6
+2
-2
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+4
-4
app/assets/javascripts/diff_notes/components/comment_resolve_btn.js.es6
...ascripts/diff_notes/components/comment_resolve_btn.js.es6
+2
-2
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
...vascripts/diff_notes/components/jump_to_discussion.js.es6
+2
-2
app/assets/javascripts/diff_notes/services/resolve.js.es6
app/assets/javascripts/diff_notes/services/resolve.js.es6
+2
-2
app/assets/javascripts/due_date_select.js.es6
app/assets/javascripts/due_date_select.js.es6
+2
-2
app/assets/javascripts/extensions/array.js.es6
app/assets/javascripts/extensions/array.js.es6
+3
-3
app/assets/javascripts/gfm_auto_complete.js.es6
app/assets/javascripts/gfm_auto_complete.js.es6
+2
-2
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+8
-8
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+2
-2
app/assets/javascripts/lib/utils/text_utility.js
app/assets/javascripts/lib/utils/text_utility.js
+3
-3
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js.es6
...cripts/merge_conflicts/components/diff_file_editor.js.es6
+2
-2
app/assets/javascripts/merge_conflicts/merge_conflict_service.js.es6
...javascripts/merge_conflicts/merge_conflict_service.js.es6
+2
-2
app/assets/javascripts/merge_conflicts/merge_conflict_store.js.es6
...s/javascripts/merge_conflicts/merge_conflict_store.js.es6
+3
-3
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js.es6
...javascripts/merge_conflicts/merge_conflicts_bundle.js.es6
+6
-6
app/assets/javascripts/merge_request_widget.js.es6
app/assets/javascripts/merge_request_widget.js.es6
+3
-3
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+3
-3
app/assets/javascripts/profile/gl_crop.js.es6
app/assets/javascripts/profile/gl_crop.js.es6
+2
-2
app/assets/javascripts/project.js
app/assets/javascripts/project.js
+2
-2
app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js.es6
...rotected_branches/protected_branch_access_dropdown.js.es6
+2
-2
app/assets/javascripts/protected_branches/protected_branch_create.js.es6
...scripts/protected_branches/protected_branch_create.js.es6
+2
-2
app/assets/javascripts/protected_branches/protected_branch_edit.js.es6
...vascripts/protected_branches/protected_branch_edit.js.es6
+2
-2
app/assets/javascripts/protected_branches/protected_branch_edit_list.js.es6
...ipts/protected_branches/protected_branch_edit_list.js.es6
+2
-2
app/assets/javascripts/right_sidebar.js
app/assets/javascripts/right_sidebar.js
+2
-2
app/assets/javascripts/search_autocomplete.js.es6
app/assets/javascripts/search_autocomplete.js.es6
+5
-5
app/assets/javascripts/snippet/snippet_bundle.js
app/assets/javascripts/snippet/snippet_bundle.js
+2
-2
app/assets/javascripts/snippets_list.js.es6
app/assets/javascripts/snippets_list.js.es6
+2
-2
app/assets/javascripts/todos.js.es6
app/assets/javascripts/todos.js.es6
+2
-2
app/assets/javascripts/user.js.es6
app/assets/javascripts/user.js.es6
+2
-2
app/assets/javascripts/user_tabs.js.es6
app/assets/javascripts/user_tabs.js.es6
+2
-2
app/assets/javascripts/users/calendar.js
app/assets/javascripts/users/calendar.js
+3
-3
spec/javascripts/activities_spec.js.es6
spec/javascripts/activities_spec.js.es6
+2
-2
spec/javascripts/diff_comments_store_spec.js.es6
spec/javascripts/diff_comments_store_spec.js.es6
+2
-2
spec/javascripts/gl_dropdown_spec.js.es6
spec/javascripts/gl_dropdown_spec.js.es6
+4
-4
spec/javascripts/graphs/stat_graph_contributors_graph_spec.js
.../javascripts/graphs/stat_graph_contributors_graph_spec.js
+83
-83
spec/javascripts/graphs/stat_graph_contributors_util_spec.js
spec/javascripts/graphs/stat_graph_contributors_util_spec.js
+96
-96
spec/javascripts/graphs/stat_graph_spec.js
spec/javascripts/graphs/stat_graph_spec.js
+3
-3
spec/javascripts/labels_issue_sidebar_spec.js.es6
spec/javascripts/labels_issue_sidebar_spec.js.es6
+3
-3
spec/javascripts/notes_spec.js
spec/javascripts/notes_spec.js
+2
-2
spec/javascripts/right_sidebar_spec.js
spec/javascripts/right_sidebar_spec.js
+2
-2
No files found.
app/assets/javascripts/boards/components/board_blank_state.js.es6
View file @
e7b5945c
/* eslint-disable space-before-function-paren, comma-dangle
, semi
*/
/* eslint-disable space-before-function-paren, comma-dangle */
/* global Vue */
/* global ListLabel */
...
...
@@ -15,7 +15,7 @@
new ListLabel({ title: 'To Do', color: '#F0AD4E' }),
new ListLabel({ title: 'Doing', color: '#5CB85C' })
]
}
}
;
},
methods: {
addDefaultLists () {
...
...
app/assets/javascripts/boards/mixins/sortable_default_options.js.es6
View file @
e7b5945c
/* eslint-disable no-unused-vars, no-mixed-operators, prefer-const, comma-dangle
, semi
*/
/* eslint-disable no-unused-vars, no-mixed-operators, prefer-const, comma-dangle */
/* global DocumentTouch */
((w) => {
...
...
@@ -31,7 +31,7 @@
scrollSpeed: 20,
onStart: gl.issueBoards.onStart,
onEnd: gl.issueBoards.onEnd
}
}
;
Object.keys(obj).forEach((key) => { defaultSortOptions[key] = obj[key]; });
return defaultSortOptions;
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
e7b5945c
/* eslint-disable space-before-function-paren, comma-dangle, no-param-reassign, camelcase, prefer-const,
no-extra-semi,
max-len, no-unused-vars */
/* eslint-disable space-before-function-paren, comma-dangle, no-param-reassign, camelcase, prefer-const, max-len, no-unused-vars */
/* global Vue */
class BoardService {
...
...
app/assets/javascripts/boards/stores/boards_store.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, space-before-function-paren, one-var, indent, space-in-parens, no-shadow, radix, dot-notation,
semi,
max-len */
/* eslint-disable comma-dangle, space-before-function-paren, one-var, indent, space-in-parens, no-shadow, radix, dot-notation, max-len */
/* global Cookies */
/* global List */
...
...
@@ -105,7 +105,7 @@
if (listTo.type === 'done' && listFrom.type !== 'backlog') {
issueLists.forEach((list) => {
list.removeIssue(issue);
})
})
;
issue.removeLabels(listLabels);
} else {
listFrom.removeIssue(issue);
...
...
app/assets/javascripts/build.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-param-reassign, quotes, yoda, no-else-return, consistent-return, comma-dangle,
semi,
object-shorthand, prefer-template, one-var, one-var-declaration-per-line, no-unused-vars, max-len, vars-on-top, padded-blocks */
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-param-reassign, quotes, yoda, no-else-return, consistent-return, comma-dangle, object-shorthand, prefer-template, one-var, one-var-declaration-per-line, no-unused-vars, max-len, vars-on-top, padded-blocks */
/* global Breakpoints */
/* global Turbolinks */
...
...
@@ -70,7 +70,7 @@
this
.
$sidebar
=
$
(
'
.js-build-sidebar
'
);
this
.
sidebarTranslationLimits
=
{
min
:
$
(
'
.navbar-gitlab
'
).
outerHeight
()
+
$
(
'
.layout-nav
'
).
outerHeight
()
}
}
;
this
.
sidebarTranslationLimits
.
max
=
this
.
sidebarTranslationLimits
.
min
+
$
(
'
.scrolling-tabs-container
'
).
outerHeight
();
this
.
$sidebar
.
css
({
top
:
this
.
sidebarTranslationLimits
.
max
...
...
@@ -85,7 +85,7 @@
};
Build
.
prototype
.
getInitialBuildTrace
=
function
()
{
var
removeRefreshStatuses
=
[
'
success
'
,
'
failed
'
,
'
canceled
'
,
'
skipped
'
]
var
removeRefreshStatuses
=
[
'
success
'
,
'
failed
'
,
'
canceled
'
,
'
skipped
'
]
;
return
$
.
ajax
({
url
:
this
.
buildUrl
,
...
...
@@ -153,7 +153,7 @@
this
.
$scrollTopBtn
.
hide
();
this
.
$scrollBottomBtn
.
hide
();
this
.
$autoScrollContainer
.
hide
();
}
}
;
// Page scroll listener to detect if user has scrolling page
// and handle following cases
...
...
app/assets/javascripts/diff_notes/components/comment_resolve_btn.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, quotes, no-lonely-if,
semi,
max-len */
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, quotes, no-lonely-if, max-len */
/* global Vue */
/* global CommentsStore */
...
...
@@ -10,7 +10,7 @@
data() {
return {
textareaIsEmpty: true
}
}
;
},
computed: {
discussion: function () {
...
...
app/assets/javascripts/diff_notes/components/jump_to_discussion.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, indent, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes
, semi
*/
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, indent, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes */
/* global Vue */
/* global DiscussionMixins */
/* global CommentsStore */
...
...
@@ -156,7 +156,7 @@
// If the next discussion is closed, toggle it open.
if ($target.find('.js-toggle-content').is(':hidden')) {
$target.find('.js-toggle-button i').trigger('click')
$target.find('.js-toggle-button i').trigger('click')
;
}
} else if (activeTab === 'diffs') {
// Resolved discussions are hidden in the diffs tab by default.
...
...
app/assets/javascripts/diff_notes/services/resolve.js.es6
View file @
e7b5945c
/* eslint-disable class-methods-use-this, one-var, indent, camelcase, no-new, comma-dangle,
semi,
no-param-reassign, max-len */
/* eslint-disable class-methods-use-this, one-var, indent, camelcase, no-new, comma-dangle, no-param-reassign, max-len */
/* global Vue */
/* global Flash */
/* global CommentsStore */
...
...
@@ -59,7 +59,7 @@
} else {
new Flash('An error occurred when trying to resolve a discussion. Please try again.', 'alert');
}
})
})
;
}
resolveAll(projectPath, mergeRequestId, discussionId) {
...
...
app/assets/javascripts/due_date_select.js.es6
View file @
e7b5945c
/* eslint-disable wrap-iife, func-names, space-before-function-paren, comma-dangle, prefer-template, consistent-return, class-methods-use-this, arrow-body-style, prefer-const, padded-blocks, no-unused-vars, no-underscore-dangle, no-new, max-len,
semi,
no-sequences, no-unused-expressions, no-param-reassign */
/* eslint-disable wrap-iife, func-names, space-before-function-paren, comma-dangle, prefer-template, consistent-return, class-methods-use-this, arrow-body-style, prefer-const, padded-blocks, no-unused-vars, no-underscore-dangle, no-new, max-len, no-sequences, no-unused-expressions, no-param-reassign */
(function(global) {
class DueDateSelect {
...
...
@@ -16,7 +16,7 @@
this.$sidebarValue = $('.js-due-date-sidebar-value', $block);
this.fieldName = $dropdown.data('field-name'),
this.abilityName = $dropdown.data('ability-name'),
this.issueUpdateURL = $dropdown.data('issue-update')
this.issueUpdateURL = $dropdown.data('issue-update')
;
this.rawSelectedDate = null;
this.displayedDate = null;
...
...
app/assets/javascripts/extensions/array.js.es6
View file @
e7b5945c
/* eslint-disable no-extend-native, func-names, space-before-function-paren, s
emi, s
pace-infix-ops, max-len */
/* eslint-disable no-extend-native, func-names, space-before-function-paren, space-infix-ops, max-len */
Array.prototype.first = function() {
return this[0];
}
}
;
Array.prototype.last = function() {
return this[this.length-1];
}
}
;
Array.prototype.find = Array.prototype.find || function(predicate, ...args) {
if (!this) throw new TypeError('Array.prototype.find called on null or undefined');
...
...
app/assets/javascripts/gfm_auto_complete.js.es6
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, no-template-curly-in-string, comma-dangle, object-shorthand, quotes, dot-notation, no-else-return, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-param-reassign, no-useless-escape, prefer-template, consistent-return, wrap-iife, prefer-arrow-callback, camelcase, no-unused-vars, no-useless-return, padded-blocks, vars-on-top, indent, no-
extra-semi, no-multi-spaces, semi
, max-len */
/* eslint-disable func-names, space-before-function-paren, no-template-curly-in-string, comma-dangle, object-shorthand, quotes, dot-notation, no-else-return, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-param-reassign, no-useless-escape, prefer-template, consistent-return, wrap-iife, prefer-arrow-callback, camelcase, no-unused-vars, no-useless-return, padded-blocks, vars-on-top, indent, no-
multi-spaces
, max-len */
// Creates the variables for setting up GFM auto-completion
(function() {
...
...
@@ -334,7 +334,7 @@
});
},
matcher: function(flag, subtext, should_startWithSpace, acceptSpaceBar) {
var regexp = /(?:^|\n)\/([A-Za-z_]*)$/gi
var regexp = /(?:^|\n)\/([A-Za-z_]*)$/gi
;
var match = regexp.exec(subtext);
if (match) {
return match[1];
...
...
app/assets/javascripts/gl_dropdown.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, space-before-blocks, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback,
semi, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, padded-blocks, prefer-template, no-param-reassign, no-loop-func, no-extra-semi
, keyword-spacing, no-mixed-operators */
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, space-before-blocks, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback,
no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, padded-blocks, prefer-template, no-param-reassign, no-loop-func
, keyword-spacing, no-mixed-operators */
/* global fuzzaldrinPlus */
/* global Turbolinks */
...
...
@@ -37,7 +37,7 @@
.
on
(
'
keydown
'
,
function
(
e
)
{
var
keyCode
=
e
.
which
;
if
(
keyCode
===
13
&&
!
options
.
elIsInput
)
{
e
.
preventDefault
()
e
.
preventDefault
()
;
}
})
.
on
(
'
input
'
,
function
()
{
...
...
@@ -206,7 +206,7 @@
SELECTABLE_CLASSES
=
"
.dropdown-content li:not(
"
+
NON_SELECTABLE_CLASSES
+
"
, .option-hidden)
"
;
CURSOR_SELECT_SCROLL_PADDING
=
5
CURSOR_SELECT_SCROLL_PADDING
=
5
;
FILTER_INPUT
=
'
.dropdown-input .dropdown-input-field
'
;
...
...
@@ -223,7 +223,7 @@
this
.
dropdown
=
selector
!=
null
?
$
(
selector
)
:
$
(
this
.
el
).
parent
();
// Set Defaults
this
.
filterInput
=
this
.
options
.
filterInput
||
this
.
getElement
(
FILTER_INPUT
);
this
.
highlight
=
!!
this
.
options
.
highlight
this
.
highlight
=
!!
this
.
options
.
highlight
;
this
.
filterInputBlur
=
this
.
options
.
filterInputBlur
!=
null
?
this
.
options
.
filterInputBlur
:
true
;
...
...
@@ -550,7 +550,7 @@
value
=
this
.
options
.
id
?
this
.
options
.
id
(
data
)
:
data
.
id
;
fieldName
=
this
.
options
.
fieldName
;
if
(
value
)
{
value
=
value
.
toString
().
replace
(
/'/g
,
'
\\\'
'
)
};
if
(
value
)
{
value
=
value
.
toString
().
replace
(
/'/g
,
'
\\\'
'
)
;
}
field
=
this
.
dropdown
.
parent
().
find
(
"
input[name='
"
+
fieldName
+
"
'][value='
"
+
value
+
"
']
"
);
if
(
field
.
length
)
{
...
...
@@ -695,8 +695,8 @@
};
GitLabDropdown
.
prototype
.
focusTextInput
=
function
()
{
if
(
this
.
options
.
filterable
)
{
this
.
filterInput
.
focus
()
}
}
if
(
this
.
options
.
filterable
)
{
this
.
filterInput
.
focus
()
;
}
}
;
GitLabDropdown
.
prototype
.
addInput
=
function
(
fieldName
,
value
,
selectedObject
)
{
var
$input
;
...
...
@@ -802,7 +802,7 @@
listItemBottom
=
listItemTop
+
listItemHeight
;
if
(
!
index
)
{
// Scroll the dropdown content to the top
$dropdownContent
.
scrollTop
(
0
)
$dropdownContent
.
scrollTop
(
0
)
;
}
else
if
(
index
===
(
$listItems
.
length
-
1
))
{
// Scroll the dropdown content to the bottom
$dropdownContent
.
scrollTop
(
$dropdownContent
.
prop
(
'
scrollHeight
'
));
...
...
app/assets/javascripts/labels_select.js
View file @
e7b5945c
/* eslint-disable no-useless-return, func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, no-unused-vars, one-var-declaration-per-line, prefer-template, no-new, consistent-return, object-shorthand, comma-dangle, no-shadow, no-param-reassign, brace-style, vars-on-top, quotes, no-lonely-if, no-else-return,
semi,
dot-notation, no-empty, no-return-assign, camelcase, prefer-spread, padded-blocks */
/* eslint-disable no-useless-return, func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, no-unused-vars, one-var-declaration-per-line, prefer-template, no-new, consistent-return, object-shorthand, comma-dangle, no-shadow, no-param-reassign, brace-style, vars-on-top, quotes, no-lonely-if, no-else-return, dot-notation, no-empty, no-return-assign, camelcase, prefer-spread, padded-blocks */
/* global Issuable */
/* global ListLabel */
...
...
@@ -333,7 +333,7 @@
if
(
$dropdown
.
parent
().
find
(
'
.is-active:not(.dropdown-clear-active)
'
).
length
)
{
$dropdown
.
parent
()
.
find
(
'
.dropdown-clear-active
'
)
.
removeClass
(
'
is-active
'
)
.
removeClass
(
'
is-active
'
)
;
}
if
(
$dropdown
.
hasClass
(
'
js-filter-bulk-update
'
)
||
$dropdown
.
hasClass
(
'
js-issuable-form-dropdown
'
))
{
...
...
app/assets/javascripts/lib/utils/text_utility.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes,
semi,
one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, padded-blocks, max-len */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, quotes, one-var, one-var-declaration-per-line, operator-assignment, no-else-return, prefer-template, prefer-arrow-callback, no-empty, max-len, consistent-return, no-unused-vars, no-return-assign, padded-blocks, max-len */
(
function
()
{
(
function
(
w
)
{
var
base
;
...
...
@@ -10,7 +10,7 @@
}
gl
.
text
.
addDelimiter
=
function
(
text
)
{
return
text
?
text
.
toString
().
replace
(
/
\B(?=(\d{3})
+
(?!\d))
/g
,
"
,
"
)
:
text
;
}
}
;
gl
.
text
.
randomString
=
function
()
{
return
Math
.
random
().
toString
(
36
).
substring
(
7
);
};
...
...
@@ -159,7 +159,7 @@
};
gl
.
text
.
humanize
=
function
(
string
)
{
return
string
.
charAt
(
0
).
toUpperCase
()
+
string
.
replace
(
/_/g
,
'
'
).
slice
(
1
);
}
}
;
return
gl
.
text
.
truncate
=
function
(
string
,
maxLength
)
{
return
string
.
substr
(
0
,
(
maxLength
-
3
))
+
'
...
'
;
};
...
...
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand, prefer-const, no-new, padded-blocks, no-param-reassign,
semi,
max-len */
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand, prefer-const, no-new, padded-blocks, no-param-reassign, max-len */
/* global Vue */
/* global ace */
/* global Flash */
...
...
@@ -19,7 +19,7 @@
loading: false,
fileLoaded: false,
originalContent: '',
}
}
;
},
computed: {
classObject() {
...
...
app/assets/javascripts/merge_conflicts/merge_conflict_service.js.es6
View file @
e7b5945c
/* eslint-disable no-param-reassign, comma-dangle,
no-extra-semi,
padded-blocks */
/* eslint-disable no-param-reassign, comma-dangle, padded-blocks */
((global) => {
global.mergeConflicts = global.mergeConflicts || {};
...
...
@@ -25,7 +25,7 @@
method: 'POST'
});
}
}
;
}
global.mergeConflicts.mergeConflictsService = mergeConflictsService;
...
...
app/assets/javascripts/merge_conflicts/merge_conflict_store.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, object-shorthand, no-dupe-keys, no-param-reassign, camelcase, prefer-const, no-nested-ternary, no-continue,
semi,
func-call-spacing, no-spaced-func, padded-blocks, max-len */
/* eslint-disable comma-dangle, object-shorthand, no-dupe-keys, no-param-reassign, camelcase, prefer-const, no-nested-ternary, no-continue, func-call-spacing, no-spaced-func, padded-blocks, max-len */
/* global Cookies */
/* global Vue */
...
...
@@ -89,7 +89,7 @@
this.decorateLineForInlineView(line, id, conflict);
file.inlineLines.push(line);
})
})
;
if (conflict) {
file.inlineLines.push(this.getOriginHeaderLine(id));
...
...
@@ -321,7 +321,7 @@
if (file.resolveMode === INTERACTIVE_RESOLVE_MODE) {
let numberConflicts = 0;
let resolvedConflicts = Object.keys(file.resolutionData).length
let resolvedConflicts = Object.keys(file.resolutionData).length
;
// We only check for conflicts type 'text'
// since conflicts `text_editor` can´t be resolved in interactive mode
...
...
app/assets/javascripts/merge_conflicts/merge_conflicts_bundle.js.es6
View file @
e7b5945c
/* eslint-disable new-cap, comma-dangle, no-new
, semi
*/
/* eslint-disable new-cap, comma-dangle, no-new */
/* global Vue */
/* global Flash */
...
...
@@ -29,10 +29,10 @@ $(() => {
'parallel-conflict-lines': gl.mergeConflicts.parallelConflictLines
},
computed: {
conflictsCountText() { return mergeConflictsStore.getConflictsCountText() },
readyToCommit() { return mergeConflictsStore.isReadyToCommit() },
commitButtonText() { return mergeConflictsStore.getCommitButtonText() },
showDiffViewTypeSwitcher() { return mergeConflictsStore.fileTextTypePresent() }
conflictsCountText() { return mergeConflictsStore.getConflictsCountText()
;
},
readyToCommit() { return mergeConflictsStore.isReadyToCommit()
;
},
commitButtonText() { return mergeConflictsStore.getCommitButtonText()
;
},
showDiffViewTypeSwitcher() { return mergeConflictsStore.fileTextTypePresent()
;
}
},
created() {
mergeConflictsService
...
...
@@ -88,5 +88,5 @@ $(() => {
});
}
}
})
})
;
});
app/assets/javascripts/merge_request_widget.js.es6
View file @
e7b5945c
/* eslint-disable max-len, no-var, func-names, space-before-function-paren, vars-on-top, comma-dangle, no-return-assign, consistent-return, no-param-reassign, one-var, one-var-declaration-per-line, quotes, prefer-template, no-else-return, prefer-arrow-callback, no-unused-vars, no-underscore-dangle, no-shadow, no-mixed-operators, template-curly-spacing, camelcase, default-case, wrap-iife,
semi,
padded-blocks */
/* eslint-disable max-len, no-var, func-names, space-before-function-paren, vars-on-top, comma-dangle, no-return-assign, consistent-return, no-param-reassign, one-var, one-var-declaration-per-line, quotes, prefer-template, no-else-return, prefer-arrow-callback, no-unused-vars, no-underscore-dangle, no-shadow, no-mixed-operators, template-curly-spacing, camelcase, default-case, wrap-iife, padded-blocks */
/* global notify */
/* global notifyPermissions */
/* global merge_request_widget */
...
...
@@ -90,7 +90,7 @@
const $ciSuccessIcon = $('.js-success-icon');
this.$ciSuccessIcon = $ciSuccessIcon.html();
$ciSuccessIcon.remove();
}
}
;
MergeRequestWidget.prototype.mergeInProgress = function(deleteSourceBranch) {
if (deleteSourceBranch == null) {
...
...
@@ -205,7 +205,7 @@
}
environment.ci_success_icon = this.$ciSuccessIcon;
const templateString = _.unescape($template[0].outerHTML);
const template = _.template(templateString)(environment)
const template = _.template(templateString)(environment)
;
this.$widgetBody.before(template);
}
};
...
...
app/assets/javascripts/notes.js
View file @
e7b5945c
/* eslint-disable no-restricted-properties, func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars,
semi,
indent, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape, radix, padded-blocks */
/* eslint-disable no-restricted-properties, func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars, indent, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape, radix, padded-blocks */
/* global Flash */
/* global GLForm */
/* global Autosave */
...
...
@@ -508,7 +508,7 @@
}
return
isAllowed
;
}
}
;
/*
...
...
@@ -903,7 +903,7 @@
$editForm
.
find
(
'
.js-note-text
'
).
focus
().
val
(
originalContent
);
$editForm
.
find
(
'
.js-md-write-button
'
).
trigger
(
'
click
'
);
$editForm
.
find
(
'
.referenced-users
'
).
hide
();
}
}
;
Notes
.
prototype
.
updateTaskList
=
function
(
e
)
{
var
$target
=
$
(
e
.
target
);
...
...
app/assets/javascripts/profile/gl_crop.js.es6
View file @
e7b5945c
/* eslint-disable no-useless-escape, max-len, padded-blocks, quotes, no-var, no-underscore-dangle, func-names, space-before-function-paren, no-unused-vars, no-return-assign, object-shorthand, one-var, one-var-declaration-per-line, comma-dangle, consistent-return, class-methods-use-this, new-parens
, semi
*/
/* eslint-disable no-useless-escape, max-len, padded-blocks, quotes, no-var, no-underscore-dangle, func-names, space-before-function-paren, no-unused-vars, no-return-assign, object-shorthand, one-var, one-var-declaration-per-line, comma-dangle, consistent-return, class-methods-use-this, new-parens */
((global) => {
...
...
@@ -169,6 +169,6 @@
return this.each(function() {
return $(this).data('glcrop', new GitLabCrop(this, opts));
});
}
}
;
})(window.gl || (window.gl = {}));
app/assets/javascripts/project.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, consistent-return, no-new, prefer-arrow-callback, no-return-assign, one-var, one-var-declaration-per-line, object-shorthand, comma-dangle, no-else-return, newline-per-chained-call, no-shadow,
semi,
vars-on-top, indent, prefer-template, padded-blocks, max-len */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, quotes, consistent-return, no-new, prefer-arrow-callback, no-return-assign, one-var, one-var-declaration-per-line, object-shorthand, comma-dangle, no-else-return, newline-per-chained-call, no-shadow, vars-on-top, indent, prefer-template, padded-blocks, max-len */
/* global Cookies */
/* global Turbolinks */
/* global ProjectSelect */
...
...
@@ -94,7 +94,7 @@
return
$el
.
text
().
trim
();
},
clicked
:
function
(
selected
,
$el
,
e
)
{
e
.
preventDefault
()
e
.
preventDefault
()
;
if
(
$
(
'
input[name="ref"]
'
).
length
)
{
var
$form
=
$dropdown
.
closest
(
'
form
'
),
action
=
$form
.
attr
(
'
action
'
),
...
...
app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js.es6
View file @
e7b5945c
/* eslint-disable arrow-parens, no-param-reassign, no-irregular-whitespace, object-shorthand, no-else-return, comma-dangle,
semi,
padded-blocks, max-len */
/* eslint-disable arrow-parens, no-param-reassign, no-irregular-whitespace, object-shorthand, no-else-return, comma-dangle, padded-blocks, max-len */
(global => {
global.gl = global.gl || {};
...
...
@@ -25,6 +25,6 @@
}
});
}
}
}
;
})(window);
app/assets/javascripts/protected_branches/protected_branch_create.js.es6
View file @
e7b5945c
/* eslint-disable no-new, arrow-parens, no-param-reassign, no-irregular-whitespace, comma-dangle, padded-blocks,
semi,
max-len */
/* eslint-disable no-new, arrow-parens, no-param-reassign, no-irregular-whitespace, comma-dangle, padded-blocks, max-len */
/* global ProtectedBranchDropdown */
(global => {
...
...
@@ -52,6 +52,6 @@
this.$form.find('input[type="submit"]').attr('disabled', !($branchInput.val() && $allowedToMergeInput.length && $allowedToPushInput.length));
}
}
}
;
})(window);
app/assets/javascripts/protected_branches/protected_branch_edit.js.es6
View file @
e7b5945c
/* eslint-disable no-new, arrow-parens, no-param-reassign, no-irregular-whitespace, padded-blocks, comma-dangle, no-trailing-spaces,
semi,
max-len */
/* eslint-disable no-new, arrow-parens, no-param-reassign, no-irregular-whitespace, padded-blocks, comma-dangle, no-trailing-spaces, max-len */
/* global Flash */
(global => {
...
...
@@ -63,6 +63,6 @@
}
});
}
}
}
;
})(window);
app/assets/javascripts/protected_branches/protected_branch_edit_list.js.es6
View file @
e7b5945c
/* eslint-disable arrow-parens, no-param-reassign, no-irregular-whitespace, no-new, comma-dangle,
semi,
padded-blocks, max-len */
/* eslint-disable arrow-parens, no-param-reassign, no-irregular-whitespace, no-new, comma-dangle, padded-blocks, max-len */
(global => {
global.gl = global.gl || {};
...
...
@@ -14,6 +14,6 @@
});
});
}
}
}
;
})(window);
app/assets/javascripts/right_sidebar.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-unused-vars,
semi,
consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, object-shorthand, comma-dangle, no-else-return, no-param-reassign, padded-blocks, max-len */
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-unused-vars, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, object-shorthand, comma-dangle, no-else-return, no-param-reassign, padded-blocks, max-len */
/* global Cookies */
(
function
()
{
...
...
@@ -18,7 +18,7 @@
$
(
'
.dropdown
'
).
off
(
'
loading.gl.dropdown
'
);
$
(
'
.dropdown
'
).
off
(
'
loaded.gl.dropdown
'
);
$
(
document
).
off
(
'
click
'
,
'
.js-sidebar-toggle
'
);
}
}
;
Sidebar
.
prototype
.
addEventListeners
=
function
()
{
this
.
sidebar
.
on
(
'
click
'
,
'
.sidebar-collapsed-icon
'
,
this
,
this
.
sidebarCollapseClicked
);
...
...
app/assets/javascripts/search_autocomplete.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, no-return-assign, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-unused-vars, no-cond-assign, consistent-return, object-shorthand, prefer-arrow-callback, func-names, space-before-function-paren, prefer-template, quotes, class-methods-use-this, no-unused-expressions, no-sequences, wrap-iife, no-lonely-if, no-else-return, no-param-reassign, vars-on-top, padded-blocks,
no-extra-semi,
indent, max-len */
/* eslint-disable comma-dangle, no-return-assign, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-unused-vars, no-cond-assign, consistent-return, object-shorthand, prefer-arrow-callback, func-names, space-before-function-paren, prefer-template, quotes, class-methods-use-this, no-unused-expressions, no-sequences, wrap-iife, no-lonely-if, no-else-return, no-param-reassign, vars-on-top, padded-blocks, indent, max-len */
((global) => {
...
...
@@ -216,7 +216,7 @@
this.dropdown.addClass('open').trigger('shown.bs.dropdown');
return this.searchInput.removeClass('disabled');
}
}
;
}
// Saves last length of the entered text
onSearchInputKeyDown() {
...
...
@@ -305,7 +305,7 @@
hasLocationBadge() {
return this.wrap.is('.has-location-badge');
}
;
}
restoreOriginalState() {
var i, input, inputs, len;
...
...
@@ -361,7 +361,7 @@
var html;
html = "<ul> <li><a class='dropdown-menu-empty-link is-focused'>Loading...</a></li> </ul>";
return this.dropdownContent.html(html);
}
;
}
onClick(item, $el, e) {
if (location.pathname.indexOf(item.url) !== -1) {
...
...
@@ -384,7 +384,7 @@
this.disableAutocomplete();
return this.searchInput.val('').focus();
}
}
;
}
}
...
...
app/assets/javascripts/snippet/snippet_bundle.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes,
semi,
padded-blocks, max-len */
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, padded-blocks, max-len */
/* global ace */
/*= require_tree . */
(
function
()
{
$
(
function
()
{
var
editor
=
ace
.
edit
(
"
editor
"
)
var
editor
=
ace
.
edit
(
"
editor
"
)
;
$
(
"
.snippet-form-holder form
"
).
on
(
'
submit
'
,
function
()
{
$
(
"
.snippet-file-content
"
).
val
(
editor
.
getValue
());
...
...
app/assets/javascripts/snippets_list.js.es6
View file @
e7b5945c
/* eslint-disable arrow-parens, no-param-reassign, space-before-function-paren, func-names, no-var,
semi,
max-len */
/* eslint-disable arrow-parens, no-param-reassign, space-before-function-paren, func-names, no-var, max-len */
(global => {
global.gl = global.gl || {};
...
...
@@ -9,5 +9,5 @@
$holder.find('.pagination').on('ajax:success', (e, data) => {
$holder.replaceWith(data.html);
});
}
}
;
})(window);
app/assets/javascripts/todos.js.es6
View file @
e7b5945c
/* eslint-disable padded-blocks, class-methods-use-this, no-new, func-names, prefer-template, no-unneeded-ternary, object-shorthand, space-before-function-paren, comma-dangle, quote-props, consistent-return, no-else-return,
semi,
no-param-reassign, max-len */
/* eslint-disable padded-blocks, class-methods-use-this, no-new, func-names, prefer-template, no-unneeded-ternary, object-shorthand, space-before-function-paren, comma-dangle, quote-props, consistent-return, no-else-return, no-param-reassign, max-len */
/* global UsersSelect */
/* global Turbolinks */
...
...
@@ -49,7 +49,7 @@
clicked: function() {
return $dropdown.closest('form.filter-form').submit();
}
})
})
;
}
doneClicked(e) {
...
...
app/assets/javascripts/user.js.es6
View file @
e7b5945c
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign
, semi
*/
/* eslint-disable class-methods-use-this, comma-dangle, arrow-parens, no-param-reassign */
/* global Cookies */
((global) => {
...
...
@@ -30,5 +30,5 @@
$(this).parents('.project-limit-message').remove();
});
}
}
}
;
})(window.gl || (window.gl = {}));
app/assets/javascripts/user_tabs.js.es6
View file @
e7b5945c
/* eslint-disable max-len, space-before-function-paren, no-underscore-dangle, array-bracket-spacing, consistent-return, comma-dangle, no-unused-vars, dot-notation, no-new, no-return-assign, camelcase,
semi,
no-param-reassign */
/* eslint-disable max-len, space-before-function-paren, no-underscore-dangle, array-bracket-spacing, consistent-return, comma-dangle, no-unused-vars, dot-notation, no-new, no-return-assign, camelcase, no-param-reassign */
/*
UserTabs
...
...
@@ -145,7 +145,7 @@ content on the Users#show page.
}
setCurrentAction(source, action) {
let new_state = source
let new_state = source
;
new_state = new_state.replace(/\/+$/, '');
new_state += this._location.search + this._location.hash;
history.replaceState({
...
...
app/assets/javascripts/users/calendar.js
View file @
e7b5945c
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, camelcase, vars-on-top,
semi,
keyword-spacing, object-shorthand, comma-dangle, eqeqeq, no-mixed-operators, no-return-assign, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, prefer-template, quotes, no-unused-vars, no-else-return, padded-blocks, max-len */
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, camelcase, vars-on-top, keyword-spacing, object-shorthand, comma-dangle, eqeqeq, no-mixed-operators, no-return-assign, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, prefer-template, quotes, no-unused-vars, no-else-return, padded-blocks, max-len */
/* global d3 */
/* global dateFormat */
...
...
@@ -20,7 +20,7 @@
this
.
timestampsTmp
=
[];
var
group
=
0
;
var
today
=
new
Date
()
var
today
=
new
Date
()
;
today
.
setHours
(
0
,
0
,
0
,
0
,
0
);
var
oneYearAgo
=
new
Date
(
today
);
...
...
@@ -74,7 +74,7 @@
}
return
extraWidthPadding
;
}
}
;
Calendar
.
prototype
.
renderSvg
=
function
(
group
)
{
var
width
=
(
group
+
1
)
*
this
.
daySizeWithSpace
+
this
.
getExtraWidthPadding
(
group
);
...
...
spec/javascripts/activities_spec.js.es6
View file @
e7b5945c
/* eslint-disable no-unused-expressions, comma-spacing, prefer-const, no-prototype-builtins,
semi,
no-new, keyword-spacing, no-shadow, max-len */
/* eslint-disable no-unused-expressions, comma-spacing, prefer-const, no-prototype-builtins, no-new, keyword-spacing, no-shadow, max-len */
/*= require js.cookie.js */
/*= require jquery.endless-scroll.js */
...
...
@@ -30,7 +30,7 @@
function getSelector(index) {
let filter = filters[index];
return `#${filter.id}_event_filter`
return `#${filter.id}_event_filter`
;
}
describe('Activities', () => {
...
...
spec/javascripts/diff_comments_store_spec.js.es6
View file @
e7b5945c
/* eslint-disable
no-extra-semi,
jasmine/no-global-setup, dot-notation, jasmine/no-expect-in-setup-teardown, max-len */
/* eslint-disable jasmine/no-global-setup, dot-notation, jasmine/no-expect-in-setup-teardown, max-len */
/* global CommentsStore */
//= require vue
...
...
@@ -9,7 +9,7 @@
(() => {
function createDiscussion(noteId = 1, resolved = true) {
CommentsStore.create('a', noteId, true, resolved, 'test');
}
;
}
beforeEach(() => {
CommentsStore.state = {};
...
...
spec/javascripts/gl_dropdown_spec.js.es6
View file @
e7b5945c
/* eslint-disable comma-dangle, prefer-const, no-param-reassign,
semi,
no-unused-expressions, arrow-spacing, max-len */
/* eslint-disable comma-dangle, prefer-const, no-param-reassign, no-unused-expressions, arrow-spacing, max-len */
/* global Turbolinks */
/*= require jquery */
...
...
@@ -40,7 +40,7 @@
let remoteMock = function remoteMock(data, term, callback) {
remoteCallback = callback.bind({}, data);
}
}
;
describe('Dropdown', function describeDropdown() {
preloadFixtures('static/gl_dropdown.html.raw');
...
...
@@ -109,8 +109,8 @@
});
it('should click the selected item on ENTER keypress', () => {
expect(this.dropdownContainerElement).toHaveClass('open')
let randomIndex = Math.floor(Math.random() * (this.projectsData.length - 1)) + 0
expect(this.dropdownContainerElement).toHaveClass('open')
;
let randomIndex = Math.floor(Math.random() * (this.projectsData.length - 1)) + 0
;
navigateWithKeys('down', randomIndex, () => {
spyOn(Turbolinks, 'visit').and.stub();
navigateWithKeys('enter', null, () => {
...
...
spec/javascripts/graphs/stat_graph_contributors_graph_spec.js
View file @
e7b5945c
/* eslint-disable quotes, indent,
semi,
object-curly-spacing, jasmine/no-suite-dupes, vars-on-top, no-var, padded-blocks, spaced-comment, max-len */
/* eslint-disable quotes, indent, object-curly-spacing, jasmine/no-suite-dupes, vars-on-top, no-var, padded-blocks, spaced-comment, max-len */
/* global d3 */
/* global ContributorsGraph */
/* global ContributorsMasterGraph */
...
...
@@ -8,126 +8,126 @@
describe
(
"
ContributorsGraph
"
,
function
()
{
describe
(
"
#set_x_domain
"
,
function
()
{
it
(
"
set the x_domain
"
,
function
()
{
ContributorsGraph
.
set_x_domain
(
20
)
expect
(
ContributorsGraph
.
prototype
.
x_domain
).
toEqual
(
20
)
})
})
ContributorsGraph
.
set_x_domain
(
20
)
;
expect
(
ContributorsGraph
.
prototype
.
x_domain
).
toEqual
(
20
)
;
});
});
describe
(
"
#set_y_domain
"
,
function
()
{
it
(
"
sets the y_domain
"
,
function
()
{
ContributorsGraph
.
set_y_domain
([{
commits
:
30
}])
expect
(
ContributorsGraph
.
prototype
.
y_domain
).
toEqual
([
0
,
30
])
})
})
ContributorsGraph
.
set_y_domain
([{
commits
:
30
}])
;
expect
(
ContributorsGraph
.
prototype
.
y_domain
).
toEqual
([
0
,
30
])
;
})
;
})
;
describe
(
"
#init_x_domain
"
,
function
()
{
it
(
"
sets the initial x_domain
"
,
function
()
{
ContributorsGraph
.
init_x_domain
([{
date
:
"
2013-01-31
"
},
{
date
:
"
2012-01-31
"
}])
expect
(
ContributorsGraph
.
prototype
.
x_domain
).
toEqual
([
"
2012-01-31
"
,
"
2013-01-31
"
])
})
})
ContributorsGraph
.
init_x_domain
([{
date
:
"
2013-01-31
"
},
{
date
:
"
2012-01-31
"
}])
;
expect
(
ContributorsGraph
.
prototype
.
x_domain
).
toEqual
([
"
2012-01-31
"
,
"
2013-01-31
"
])
;
})
;
})
;
describe
(
"
#init_y_domain
"
,
function
()
{
it
(
"
sets the initial y_domain
"
,
function
()
{
ContributorsGraph
.
init_y_domain
([{
commits
:
30
}])
expect
(
ContributorsGraph
.
prototype
.
y_domain
).
toEqual
([
0
,
30
])
})
})
ContributorsGraph
.
init_y_domain
([{
commits
:
30
}])
;
expect
(
ContributorsGraph
.
prototype
.
y_domain
).
toEqual
([
0
,
30
])
;
})
;
})
;
describe
(
"
#init_domain
"
,
function
()
{
it
(
"
calls init_x_domain and init_y_domain
"
,
function
()
{
spyOn
(
ContributorsGraph
,
"
init_x_domain
"
)
spyOn
(
ContributorsGraph
,
"
init_y_domain
"
)
ContributorsGraph
.
init_domain
()
expect
(
ContributorsGraph
.
init_x_domain
).
toHaveBeenCalled
()
expect
(
ContributorsGraph
.
init_y_domain
).
toHaveBeenCalled
()
})
})
spyOn
(
ContributorsGraph
,
"
init_x_domain
"
)
;
spyOn
(
ContributorsGraph
,
"
init_y_domain
"
)
;
ContributorsGraph
.
init_domain
()
;
expect
(
ContributorsGraph
.
init_x_domain
).
toHaveBeenCalled
()
;
expect
(
ContributorsGraph
.
init_y_domain
).
toHaveBeenCalled
()
;
})
;
})
;
describe
(
"
#set_dates
"
,
function
()
{
it
(
"
sets the dates
"
,
function
()
{
ContributorsGraph
.
set_dates
(
"
2013-12-01
"
)
expect
(
ContributorsGraph
.
prototype
.
dates
).
toEqual
(
"
2013-12-01
"
)
})
})
ContributorsGraph
.
set_dates
(
"
2013-12-01
"
)
;
expect
(
ContributorsGraph
.
prototype
.
dates
).
toEqual
(
"
2013-12-01
"
)
;
})
;
})
;
describe
(
"
#set_x_domain
"
,
function
()
{
it
(
"
sets the instance's x domain using the prototype's x_domain
"
,
function
()
{
ContributorsGraph
.
prototype
.
x_domain
=
20
var
instance
=
new
ContributorsGraph
()
instance
.
x
=
d3
.
time
.
scale
().
range
([
0
,
100
]).
clamp
(
true
)
spyOn
(
instance
.
x
,
'
domain
'
)
instance
.
set_x_domain
()
expect
(
instance
.
x
.
domain
).
toHaveBeenCalledWith
(
20
)
})
})
ContributorsGraph
.
prototype
.
x_domain
=
20
;
var
instance
=
new
ContributorsGraph
()
;
instance
.
x
=
d3
.
time
.
scale
().
range
([
0
,
100
]).
clamp
(
true
)
;
spyOn
(
instance
.
x
,
'
domain
'
)
;
instance
.
set_x_domain
()
;
expect
(
instance
.
x
.
domain
).
toHaveBeenCalledWith
(
20
)
;
})
;
})
;
describe
(
"
#set_y_domain
"
,
function
()
{
it
(
"
sets the instance's y domain using the prototype's y_domain
"
,
function
()
{
ContributorsGraph
.
prototype
.
y_domain
=
30
var
instance
=
new
ContributorsGraph
()
instance
.
y
=
d3
.
scale
.
linear
().
range
([
100
,
0
]).
nice
()
spyOn
(
instance
.
y
,
'
domain
'
)
instance
.
set_y_domain
()
expect
(
instance
.
y
.
domain
).
toHaveBeenCalledWith
(
30
)
})
})
ContributorsGraph
.
prototype
.
y_domain
=
30
;
var
instance
=
new
ContributorsGraph
()
;
instance
.
y
=
d3
.
scale
.
linear
().
range
([
100
,
0
]).
nice
()
;
spyOn
(
instance
.
y
,
'
domain
'
)
;
instance
.
set_y_domain
()
;
expect
(
instance
.
y
.
domain
).
toHaveBeenCalledWith
(
30
)
;
})
;
})
;
describe
(
"
#set_domain
"
,
function
()
{
it
(
"
calls set_x_domain and set_y_domain
"
,
function
()
{
var
instance
=
new
ContributorsGraph
()
spyOn
(
instance
,
'
set_x_domain
'
)
spyOn
(
instance
,
'
set_y_domain
'
)
instance
.
set_domain
()
expect
(
instance
.
set_x_domain
).
toHaveBeenCalled
()
expect
(
instance
.
set_y_domain
).
toHaveBeenCalled
()
})
})
var
instance
=
new
ContributorsGraph
()
;
spyOn
(
instance
,
'
set_x_domain
'
)
;
spyOn
(
instance
,
'
set_y_domain
'
)
;
instance
.
set_domain
()
;
expect
(
instance
.
set_x_domain
).
toHaveBeenCalled
()
;
expect
(
instance
.
set_y_domain
).
toHaveBeenCalled
()
;
})
;
})
;
describe
(
"
#set_data
"
,
function
()
{
it
(
"
sets the data
"
,
function
()
{
var
instance
=
new
ContributorsGraph
()
instance
.
set_data
(
"
20
"
)
expect
(
instance
.
data
).
toEqual
(
"
20
"
)
})
})
})
var
instance
=
new
ContributorsGraph
()
;
instance
.
set_data
(
"
20
"
)
;
expect
(
instance
.
data
).
toEqual
(
"
20
"
)
;
})
;
})
;
})
;
describe
(
"
ContributorsMasterGraph
"
,
function
()
{
// TODO: fix or remove
//describe("#process_dates", function () {
//it("gets and parses dates", function () {
//var graph = new ContributorsMasterGraph()
//var data = 'random data here'
//spyOn(graph, 'parse_dates')
//spyOn(graph, 'get_dates').andReturn("get")
//spyOn(ContributorsGraph,'set_dates').andCallThrough()
//graph.process_dates(data)
//expect(graph.parse_dates).toHaveBeenCalledWith(data)
//expect(graph.get_dates).toHaveBeenCalledWith(data)
//expect(ContributorsGraph.set_dates).toHaveBeenCalledWith("get")
//})
//})
//var graph = new ContributorsMasterGraph()
;
//var data = 'random data here'
;
//spyOn(graph, 'parse_dates')
;
//spyOn(graph, 'get_dates').andReturn("get")
;
//spyOn(ContributorsGraph,'set_dates').andCallThrough()
;
//graph.process_dates(data)
;
//expect(graph.parse_dates).toHaveBeenCalledWith(data)
;
//expect(graph.get_dates).toHaveBeenCalledWith(data)
;
//expect(ContributorsGraph.set_dates).toHaveBeenCalledWith("get")
;
//})
;
//})
;
describe
(
"
#get_dates
"
,
function
()
{
it
(
"
plucks the date field from data collection
"
,
function
()
{
var
graph
=
new
ContributorsMasterGraph
()
var
data
=
[{
date
:
"
2013-01-01
"
},
{
date
:
"
2012-12-15
"
}]
expect
(
graph
.
get_dates
(
data
)).
toEqual
([
"
2013-01-01
"
,
"
2012-12-15
"
])
})
})
var
graph
=
new
ContributorsMasterGraph
()
;
var
data
=
[{
date
:
"
2013-01-01
"
},
{
date
:
"
2012-12-15
"
}]
;
expect
(
graph
.
get_dates
(
data
)).
toEqual
([
"
2013-01-01
"
,
"
2012-12-15
"
])
;
})
;
})
;
describe
(
"
#parse_dates
"
,
function
()
{
it
(
"
parses the dates
"
,
function
()
{
var
graph
=
new
ContributorsMasterGraph
()
var
parseDate
=
d3
.
time
.
format
(
"
%Y-%m-%d
"
).
parse
var
data
=
[{
date
:
"
2013-01-01
"
},
{
date
:
"
2012-12-15
"
}]
var
correct
=
[{
date
:
parseDate
(
data
[
0
].
date
)},
{
date
:
parseDate
(
data
[
1
].
date
)}]
graph
.
parse_dates
(
data
)
expect
(
data
).
toEqual
(
correct
)
})
})
var
graph
=
new
ContributorsMasterGraph
()
;
var
parseDate
=
d3
.
time
.
format
(
"
%Y-%m-%d
"
).
parse
;
var
data
=
[{
date
:
"
2013-01-01
"
},
{
date
:
"
2012-12-15
"
}]
;
var
correct
=
[{
date
:
parseDate
(
data
[
0
].
date
)},
{
date
:
parseDate
(
data
[
1
].
date
)}]
;
graph
.
parse_dates
(
data
)
;
expect
(
data
).
toEqual
(
correct
)
;
})
;
})
;
})
})
;
spec/javascripts/graphs/stat_graph_contributors_util_spec.js
View file @
e7b5945c
/* eslint-disable quotes, padded-blocks, no-var, camelcase, object-curly-spacing,
semi,
indent, object-property-newline, comma-dangle, comma-spacing, spaced-comment, max-len, key-spacing, vars-on-top, quote-props, no-multi-spaces */
/* eslint-disable quotes, padded-blocks, no-var, camelcase, object-curly-spacing, indent, object-property-newline, comma-dangle, comma-spacing, spaced-comment, max-len, key-spacing, vars-on-top, quote-props, no-multi-spaces */
/* global ContributorsStatGraphUtil */
//= require graphs/stat_graph_contributors_util
...
...
@@ -11,7 +11,7 @@ describe("ContributorsStatGraphUtil", function () {
{
author_email
:
"
karlo@email.com
"
,
author_name
:
"
Karlo Soriano
"
,
date
:
"
2013-05-09
"
,
additions
:
471
},
{
author_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
6
,
deletions
:
1
},
{
author_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
19
,
deletions
:
3
},
{
author_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
29
,
deletions
:
3
}]
{
author_email
:
"
dzaporozhets@email.com
"
,
author_name
:
"
Dmitriy Zaporozhets
"
,
date
:
"
2013-05-08
"
,
additions
:
29
,
deletions
:
3
}]
;
var
correct_parsed_log
=
{
total
:
[
...
...
@@ -28,106 +28,106 @@ describe("ContributorsStatGraphUtil", function () {
"
2013-05-08
"
:
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}
}
]
}
expect
(
ContributorsStatGraphUtil
.
parse_log
(
fake_log
)).
toEqual
(
correct_parsed_log
)
})
})
}
;
expect
(
ContributorsStatGraphUtil
.
parse_log
(
fake_log
)).
toEqual
(
correct_parsed_log
)
;
})
;
})
;
describe
(
"
#store_data
"
,
function
()
{
var
fake_entry
=
{
author
:
"
Karlo Soriano
"
,
date
:
"
2013-05-09
"
,
additions
:
471
}
var
fake_total
=
{}
var
fake_by_author
=
{}
var
fake_entry
=
{
author
:
"
Karlo Soriano
"
,
date
:
"
2013-05-09
"
,
additions
:
471
}
;
var
fake_total
=
{}
;
var
fake_by_author
=
{}
;
it
(
"
calls #store_commits
"
,
function
()
{
spyOn
(
ContributorsStatGraphUtil
,
'
store_commits
'
)
ContributorsStatGraphUtil
.
store_data
(
fake_entry
,
fake_total
,
fake_by_author
)
expect
(
ContributorsStatGraphUtil
.
store_commits
).
toHaveBeenCalled
()
})
spyOn
(
ContributorsStatGraphUtil
,
'
store_commits
'
)
;
ContributorsStatGraphUtil
.
store_data
(
fake_entry
,
fake_total
,
fake_by_author
)
;
expect
(
ContributorsStatGraphUtil
.
store_commits
).
toHaveBeenCalled
()
;
})
;
it
(
"
calls #store_additions
"
,
function
()
{
spyOn
(
ContributorsStatGraphUtil
,
'
store_additions
'
)
ContributorsStatGraphUtil
.
store_data
(
fake_entry
,
fake_total
,
fake_by_author
)
expect
(
ContributorsStatGraphUtil
.
store_additions
).
toHaveBeenCalled
()
})
spyOn
(
ContributorsStatGraphUtil
,
'
store_additions
'
)
;
ContributorsStatGraphUtil
.
store_data
(
fake_entry
,
fake_total
,
fake_by_author
)
;
expect
(
ContributorsStatGraphUtil
.
store_additions
).
toHaveBeenCalled
()
;
})
;
it
(
"
calls #store_deletions
"
,
function
()
{
spyOn
(
ContributorsStatGraphUtil
,
'
store_deletions
'
)
ContributorsStatGraphUtil
.
store_data
(
fake_entry
,
fake_total
,
fake_by_author
)
expect
(
ContributorsStatGraphUtil
.
store_deletions
).
toHaveBeenCalled
()
})
spyOn
(
ContributorsStatGraphUtil
,
'
store_deletions
'
)
;
ContributorsStatGraphUtil
.
store_data
(
fake_entry
,
fake_total
,
fake_by_author
)
;
expect
(
ContributorsStatGraphUtil
.
store_deletions
).
toHaveBeenCalled
()
;
})
;
})
})
;
// TODO: fix or remove
//describe("#store_commits", function () {
//var fake_total = "fake_total"
//var fake_by_author = "fake_by_author"
//var fake_total = "fake_total"
;
//var fake_by_author = "fake_by_author"
;
//it("calls #add twice with arguments fake_total and fake_by_author respectively", function () {
//spyOn(ContributorsStatGraphUtil, 'add')
//ContributorsStatGraphUtil.store_commits(fake_total, fake_by_author)
//expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "commits", 1], ["fake_by_author", "commits", 1]])
//})
//})
//spyOn(ContributorsStatGraphUtil, 'add')
;
//ContributorsStatGraphUtil.store_commits(fake_total, fake_by_author)
;
//expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "commits", 1], ["fake_by_author", "commits", 1]])
;
//})
;
//})
;
describe
(
"
#add
"
,
function
()
{
it
(
"
adds 1 to current test_field in collection
"
,
function
()
{
var
fake_collection
=
{
test_field
:
10
}
ContributorsStatGraphUtil
.
add
(
fake_collection
,
"
test_field
"
,
1
)
expect
(
fake_collection
.
test_field
).
toEqual
(
11
)
})
var
fake_collection
=
{
test_field
:
10
}
;
ContributorsStatGraphUtil
.
add
(
fake_collection
,
"
test_field
"
,
1
)
;
expect
(
fake_collection
.
test_field
).
toEqual
(
11
)
;
})
;
it
(
"
inits and adds 1 if test_field in collection is not defined
"
,
function
()
{
var
fake_collection
=
{}
ContributorsStatGraphUtil
.
add
(
fake_collection
,
"
test_field
"
,
1
)
expect
(
fake_collection
.
test_field
).
toEqual
(
1
)
})
})
var
fake_collection
=
{}
;
ContributorsStatGraphUtil
.
add
(
fake_collection
,
"
test_field
"
,
1
)
;
expect
(
fake_collection
.
test_field
).
toEqual
(
1
)
;
})
;
})
;
// TODO: fix or remove
//describe("#store_additions", function () {
//var fake_entry = {additions: 10}
//var fake_total= "fake_total"
//var fake_by_author = "fake_by_author"
//var fake_entry = {additions: 10}
;
//var fake_total= "fake_total"
;
//var fake_by_author = "fake_by_author"
;
//it("calls #add twice with arguments fake_total and fake_by_author respectively", function () {
//spyOn(ContributorsStatGraphUtil, 'add')
//ContributorsStatGraphUtil.store_additions(fake_entry, fake_total, fake_by_author)
//expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "additions", 10], ["fake_by_author", "additions", 10]])
//})
//})
//spyOn(ContributorsStatGraphUtil, 'add')
;
//ContributorsStatGraphUtil.store_additions(fake_entry, fake_total, fake_by_author)
;
//expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "additions", 10], ["fake_by_author", "additions", 10]])
;
//})
;
//})
;
// TODO: fix or remove
//describe("#store_deletions", function () {
//var fake_entry = {deletions: 10}
//var fake_total= "fake_total"
//var fake_by_author = "fake_by_author"
//var fake_entry = {deletions: 10}
;
//var fake_total= "fake_total"
;
//var fake_by_author = "fake_by_author"
;
//it("calls #add twice with arguments fake_total and fake_by_author respectively", function () {
//spyOn(ContributorsStatGraphUtil, 'add')
//ContributorsStatGraphUtil.store_deletions(fake_entry, fake_total, fake_by_author)
//expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "deletions", 10], ["fake_by_author", "deletions", 10]])
//})
//})
//spyOn(ContributorsStatGraphUtil, 'add')
;
//ContributorsStatGraphUtil.store_deletions(fake_entry, fake_total, fake_by_author)
;
//expect(ContributorsStatGraphUtil.add.argsForCall).toEqual([["fake_total", "deletions", 10], ["fake_by_author", "deletions", 10]])
;
//})
;
//})
;
describe
(
"
#add_date
"
,
function
()
{
it
(
"
adds a date field to the collection
"
,
function
()
{
var
fake_date
=
"
2013-10-02
"
var
fake_collection
=
{}
ContributorsStatGraphUtil
.
add_date
(
fake_date
,
fake_collection
)
expect
(
fake_collection
[
fake_date
].
date
).
toEqual
(
"
2013-10-02
"
)
})
})
var
fake_date
=
"
2013-10-02
"
;
var
fake_collection
=
{}
;
ContributorsStatGraphUtil
.
add_date
(
fake_date
,
fake_collection
)
;
expect
(
fake_collection
[
fake_date
].
date
).
toEqual
(
"
2013-10-02
"
)
;
})
;
})
;
describe
(
"
#add_author
"
,
function
()
{
it
(
"
adds an author field to the collection
"
,
function
()
{
var
fake_author
=
{
author_name
:
"
Author
"
,
author_email
:
'
fake@email.com
'
}
var
fake_author_collection
=
{}
var
fake_email_collection
=
{}
ContributorsStatGraphUtil
.
add_author
(
fake_author
,
fake_author_collection
,
fake_email_collection
)
expect
(
fake_author_collection
[
fake_author
.
author_name
].
author_name
).
toEqual
(
"
Author
"
)
expect
(
fake_email_collection
[
fake_author
.
author_email
].
author_name
).
toEqual
(
"
Author
"
)
})
})
var
fake_author
=
{
author_name
:
"
Author
"
,
author_email
:
'
fake@email.com
'
}
;
var
fake_author_collection
=
{}
;
var
fake_email_collection
=
{}
;
ContributorsStatGraphUtil
.
add_author
(
fake_author
,
fake_author_collection
,
fake_email_collection
)
;
expect
(
fake_author_collection
[
fake_author
.
author_name
].
author_name
).
toEqual
(
"
Author
"
)
;
expect
(
fake_email_collection
[
fake_author
.
author_email
].
author_name
).
toEqual
(
"
Author
"
)
;
})
;
})
;
describe
(
"
#get_total_data
"
,
function
()
{
it
(
"
returns the collection sorted via specified field
"
,
function
()
{
...
...
@@ -146,19 +146,19 @@ describe("ContributorsStatGraphUtil", function () {
]};
var
correct_total_data
=
[{
date
:
"
2013-05-08
"
,
commits
:
3
},
{
date
:
"
2013-05-09
"
,
commits
:
1
}];
expect
(
ContributorsStatGraphUtil
.
get_total_data
(
fake_parsed_log
,
"
commits
"
)).
toEqual
(
correct_total_data
)
})
})
expect
(
ContributorsStatGraphUtil
.
get_total_data
(
fake_parsed_log
,
"
commits
"
)).
toEqual
(
correct_total_data
)
;
})
;
})
;
describe
(
"
#pick_field
"
,
function
()
{
it
(
"
returns the collection with only the specified field and date
"
,
function
()
{
var
fake_parsed_log_total
=
[{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
},
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}];
ContributorsStatGraphUtil
.
pick_field
(
fake_parsed_log_total
,
"
commits
"
)
ContributorsStatGraphUtil
.
pick_field
(
fake_parsed_log_total
,
"
commits
"
)
;
var
correct_pick_field_data
=
[{
date
:
"
2013-05-09
"
,
commits
:
1
},{
date
:
"
2013-05-08
"
,
commits
:
3
}];
expect
(
ContributorsStatGraphUtil
.
pick_field
(
fake_parsed_log_total
,
"
commits
"
)).
toEqual
(
correct_pick_field_data
)
})
})
expect
(
ContributorsStatGraphUtil
.
pick_field
(
fake_parsed_log_total
,
"
commits
"
)).
toEqual
(
correct_pick_field_data
)
;
})
;
})
;
describe
(
"
#get_author_data
"
,
function
()
{
it
(
"
returns the log by author sorted by specified field
"
,
function
()
{
...
...
@@ -177,39 +177,39 @@ describe("ContributorsStatGraphUtil", function () {
"
2013-05-08
"
:
{
date
:
"
2013-05-08
"
,
additions
:
54
,
deletions
:
7
,
commits
:
3
}
}
]
}
}
;
var
correct_author_data
=
[
{
author_name
:
"
Dmitriy Zaporozhets
"
,
author_email
:
"
dzaporozhets@email.com
"
,
dates
:{
"
2013-05-08
"
:
3
},
deletions
:
7
,
additions
:
54
,
"
commits
"
:
3
},
{
author_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}
]
expect
(
ContributorsStatGraphUtil
.
get_author_data
(
fake_parsed_log
,
"
commits
"
)).
toEqual
(
correct_author_data
)
})
})
]
;
expect
(
ContributorsStatGraphUtil
.
get_author_data
(
fake_parsed_log
,
"
commits
"
)).
toEqual
(
correct_author_data
)
;
})
;
})
;
describe
(
"
#parse_log_entry
"
,
function
()
{
it
(
"
adds the corresponding info from the log entry to the author
"
,
function
()
{
var
fake_log_entry
=
{
author_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
"
2013-05-09
"
:
{
date
:
"
2013-05-09
"
,
additions
:
471
,
deletions
:
0
,
commits
:
1
}
}
var
correct_parsed_log
=
{
author_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}
expect
(
ContributorsStatGraphUtil
.
parse_log_entry
(
fake_log_entry
,
'
commits
'
,
null
)).
toEqual
(
correct_parsed_log
)
})
})
}
;
var
correct_parsed_log
=
{
author_name
:
"
Karlo Soriano
"
,
author_email
:
"
karlo@email.com
"
,
dates
:{
"
2013-05-09
"
:
1
},
deletions
:
0
,
additions
:
471
,
commits
:
1
}
;
expect
(
ContributorsStatGraphUtil
.
parse_log_entry
(
fake_log_entry
,
'
commits
'
,
null
)).
toEqual
(
correct_parsed_log
)
;
})
;
})
;
describe
(
"
#in_range
"
,
function
()
{
var
date
=
"
2013-05-09
"
var
date
=
"
2013-05-09
"
;
it
(
"
returns true if date_range is null
"
,
function
()
{
expect
(
ContributorsStatGraphUtil
.
in_range
(
date
,
null
)).
toEqual
(
true
)
})
expect
(
ContributorsStatGraphUtil
.
in_range
(
date
,
null
)).
toEqual
(
true
)
;
})
;
it
(
"
returns true if date is in range
"
,
function
()
{
var
date_range
=
[
new
Date
(
"
2013-01-01
"
),
new
Date
(
"
2013-12-12
"
)]
expect
(
ContributorsStatGraphUtil
.
in_range
(
date
,
date_range
)).
toEqual
(
true
)
})
var
date_range
=
[
new
Date
(
"
2013-01-01
"
),
new
Date
(
"
2013-12-12
"
)]
;
expect
(
ContributorsStatGraphUtil
.
in_range
(
date
,
date_range
)).
toEqual
(
true
)
;
})
;
it
(
"
returns false if date is not in range
"
,
function
()
{
var
date_range
=
[
new
Date
(
"
1999-12-01
"
),
new
Date
(
"
2000-12-01
"
)]
expect
(
ContributorsStatGraphUtil
.
in_range
(
date
,
date_range
)).
toEqual
(
false
)
})
})
var
date_range
=
[
new
Date
(
"
1999-12-01
"
),
new
Date
(
"
2000-12-01
"
)]
;
expect
(
ContributorsStatGraphUtil
.
in_range
(
date
,
date_range
)).
toEqual
(
false
)
;
})
;
})
;
})
})
;
spec/javascripts/graphs/stat_graph_spec.js
View file @
e7b5945c
/* eslint-disable quotes, padded-blocks
, semi
*/
/* eslint-disable quotes, padded-blocks */
/* global StatGraph */
//= require graphs/stat_graph
...
...
@@ -16,7 +16,7 @@ describe("StatGraph", function () {
it
(
"
sets the log
"
,
function
()
{
StatGraph
.
set_log
(
"
test
"
);
expect
(
StatGraph
.
log
).
toBe
(
"
test
"
);
})
})
})
;
})
;
});
spec/javascripts/labels_issue_sidebar_spec.js.es6
View file @
e7b5945c
/* eslint-disable no-new, object-curly-spacing, prefer-const
, semi
*/
/* eslint-disable no-new, object-curly-spacing, prefer-const */
/* global IssuableContext */
/* global LabelsSelect */
...
...
@@ -26,14 +26,14 @@
spyOn(jQuery, 'ajax').and.callFake((req) => {
const d = $.Deferred();
let LABELS_DATA = []
let LABELS_DATA = []
;
if (req.url === '/root/test/labels.json') {
for (let i = 0; i < 10; i += 1) {
LABELS_DATA.push({id: i, title: `test ${i}`, color: '#5CB85C'});
}
} else if (req.url === '/root/test/issues/2.json') {
let tmp = []
let tmp = []
;
for (let i = 0; i < saveLabelCount; i += 1) {
tmp.push({id: i, title: `test ${i}`, color: '#5CB85C'});
}
...
...
spec/javascripts/notes_spec.js
View file @
e7b5945c
/* eslint-disable space-before-function-paren, no-unused-expressions, no-var, object-shorthand, comma-dangle,
semi,
padded-blocks, max-len */
/* eslint-disable space-before-function-paren, no-unused-expressions, no-var, object-shorthand, comma-dangle, padded-blocks, max-len */
/* global Notes */
/*= require notes */
...
...
@@ -72,7 +72,7 @@
$
(
'
.js-comment-button
'
).
click
();
expect
(
this
.
autoSizeSpy
).
toHaveBeenTriggered
();
})
})
;
});
});
...
...
spec/javascripts/right_sidebar_spec.js
View file @
e7b5945c
/* eslint-disable space-before-function-paren, no-var, one-var, one-var-declaration-per-line, new-parens, no-return-assign, new-cap, vars-on-top,
semi,
padded-blocks, max-len */
/* eslint-disable space-before-function-paren, no-var, one-var, one-var-declaration-per-line, new-parens, no-return-assign, new-cap, vars-on-top, padded-blocks, max-len */
/* global Sidebar */
/*= require right_sidebar */
...
...
@@ -78,7 +78,7 @@
$
(
'
.js-issuable-todo
'
).
click
();
expect
(
todoToggleSpy
.
calls
.
count
()).
toEqual
(
1
);
})
})
;
});
}).
call
(
this
);
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