BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
001c904f
Unverified
Commit
001c904f
authored
Jun 08, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove inclusive JS imports
parent
421e41c9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
34 deletions
+20
-34
close_reopen_report_toggle.js
app/assets/javascripts/close_reopen_report_toggle.js
+2
-2
issue.js
app/assets/javascripts/issue.js
+2
-2
merge_request.js
app/assets/javascripts/merge_request.js
+2
-2
close_reopen_report_toggle_spec.js
spec/javascripts/close_reopen_report_toggle_spec.js
+6
-8
issue_spec.js
spec/javascripts/issue_spec.js
+4
-10
merge_request_spec.js
spec/javascripts/merge_request_spec.js
+4
-10
No files found.
app/assets/javascripts/close_reopen_report_toggle.js
View file @
001c904f
import
*
as
DropLab
from
'./droplab/drop_lab'
;
import
DropLab
from
'./droplab/drop_lab'
;
import
ISetter
from
'./droplab/plugins/input_setter'
;
// Todo: Remove this when fixing issue in input_setter plugin
...
...
@@ -15,7 +15,7 @@ class CloseReopenReportToggle {
this
.
reopenItem
=
this
.
dropdownList
.
querySelector
(
'.reopen-item'
);
this
.
closeItem
=
this
.
dropdownList
.
querySelector
(
'.close-item'
);
this
.
droplab
=
new
DropLab
.
default
();
this
.
droplab
=
new
DropLab
();
const
config
=
this
.
setConfig
();
...
...
app/assets/javascripts/issue.js
View file @
001c904f
...
...
@@ -6,7 +6,7 @@ import '~/lib/utils/text_utility';
import
'./flash'
;
import
'./task_list'
;
import
CreateMergeRequestDropdown
from
'./create_merge_request_dropdown'
;
import
*
as
CloseReopenReportToggle
from
'./close_reopen_report_toggle'
;
import
CloseReopenReportToggle
from
'./close_reopen_report_toggle'
;
class
Issue
{
constructor
()
{
...
...
@@ -98,7 +98,7 @@ class Issue {
const
dropdownList
=
container
.
querySelector
(
'.js-issuable-close-menu'
);
const
button
=
container
.
querySelector
(
'.js-issuable-close-button'
);
this
.
closeReopenReportToggle
=
new
CloseReopenReportToggle
.
default
({
this
.
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
dropdownTrigger
,
dropdownList
,
button
,
...
...
app/assets/javascripts/merge_request.js
View file @
001c904f
...
...
@@ -4,7 +4,7 @@
import
'vendor/jquery.waitforimages'
;
import
'./task_list'
;
import
'./merge_request_tabs'
;
import
*
as
CloseReopenReportToggle
from
'./close_reopen_report_toggle'
;
import
CloseReopenReportToggle
from
'./close_reopen_report_toggle'
;
(
function
()
{
this
.
MergeRequest
=
(
function
()
{
...
...
@@ -130,7 +130,7 @@ import * as CloseReopenReportToggle from './close_reopen_report_toggle';
const
dropdownList
=
container
.
querySelector
(
'.js-issuable-close-menu'
);
const
button
=
container
.
querySelector
(
'.js-issuable-close-button'
);
const
closeReopenReportToggle
=
new
CloseReopenReportToggle
.
default
({
const
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
dropdownTrigger
,
dropdownList
,
button
,
...
...
spec/javascripts/close_reopen_report_toggle_spec.js
View file @
001c904f
import
CloseReopenReportToggle
from
'~/close_reopen_report_toggle'
;
import
*
as
DropLab
from
'~/droplab/drop_lab'
;
import
DropLab
from
'~/droplab/drop_lab'
;
describe
(
'CloseReopenReportToggle'
,
()
=>
{
describe
(
'class constructor'
,
()
=>
{
...
...
@@ -32,7 +32,6 @@ describe('CloseReopenReportToggle', () => {
describe
(
'initDroplab'
,
()
=>
{
let
closeReopenReportToggle
;
const
dropdownList
=
jasmine
.
createSpyObj
(
'dropdownList'
,
[
'querySelector'
]);
const
droplab
=
jasmine
.
createSpyObj
(
'droplab'
,
[
'init'
]);
const
dropdownTrigger
=
{};
const
button
=
{};
const
reopenItem
=
{};
...
...
@@ -40,7 +39,7 @@ describe('CloseReopenReportToggle', () => {
const
config
=
{};
beforeEach
(()
=>
{
spyOn
(
DropLab
,
'default'
).
and
.
returnValue
(
droplab
);
spyOn
(
DropLab
.
prototype
,
'init'
);
dropdownList
.
querySelector
.
and
.
returnValues
(
reopenItem
,
closeItem
);
closeReopenReportToggle
=
new
CloseReopenReportToggle
({
...
...
@@ -61,17 +60,16 @@ describe('CloseReopenReportToggle', () => {
expect
(
closeReopenReportToggle
.
closeItem
).
toBe
(
closeItem
);
});
it
(
'instantiates DropLab and set .droplab'
,
()
=>
{
expect
(
DropLab
.
default
).
toHaveBeenCalled
();
expect
(
closeReopenReportToggle
.
droplab
).
toBe
(
droplab
);
it
(
'sets .droplab'
,
()
=>
{
expect
(
closeReopenReportToggle
.
droplab
).
toEqual
(
jasmine
.
any
(
Object
));
});
it
(
'calls .setConfig'
,
()
=>
{
expect
(
closeReopenReportToggle
.
setConfig
).
toHaveBeenCalled
();
});
it
(
'calls
.
droplab.init'
,
()
=>
{
expect
(
droplab
.
init
).
toHaveBeenCalledWith
(
it
(
'calls droplab.init'
,
()
=>
{
expect
(
DropLab
.
prototype
.
init
).
toHaveBeenCalledWith
(
dropdownTrigger
,
dropdownList
,
jasmine
.
any
(
Array
),
...
...
spec/javascripts/issue_spec.js
View file @
001c904f
/* eslint-disable space-before-function-paren, one-var, one-var-declaration-per-line, no-use-before-define, comma-dangle, max-len */
import
Issue
from
'~/issue'
;
import
*
as
CloseReopenReportToggle
from
'~/close_reopen_report_toggle'
;
import
CloseReopenReportToggle
from
'~/close_reopen_report_toggle'
;
import
'~/lib/utils/text_utility'
;
describe
(
'Issue'
,
function
()
{
...
...
@@ -208,15 +208,14 @@ describe('Issue', function() {
});
describe
(
'initCloseReopenReport'
,
()
=>
{
it
(
'
inits a new CloseReopenReportToggle instance and
calls .initDroplab'
,
()
=>
{
it
(
'calls .initDroplab'
,
()
=>
{
const
container
=
jasmine
.
createSpyObj
(
'container'
,
[
'querySelector'
]);
const
closeReopenReportToggle
=
jasmine
.
createSpyObj
(
'closeReopenReportToggle'
,
[
'initDroplab'
]);
const
dropdownTrigger
=
{};
const
dropdownList
=
{};
const
button
=
{};
spyOn
(
document
,
'querySelector'
).
and
.
returnValue
(
container
);
spyOn
(
CloseReopenReportToggle
,
'default'
).
and
.
returnValue
(
closeReopenReportToggle
);
spyOn
(
CloseReopenReportToggle
.
prototype
,
'initDroplab'
);
container
.
querySelector
.
and
.
returnValues
(
dropdownTrigger
,
dropdownList
,
button
);
Issue
.
prototype
.
initCloseReopenReport
();
...
...
@@ -225,12 +224,7 @@ describe('Issue', function() {
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'.js-issuable-close-toggle'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'.js-issuable-close-menu'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'.js-issuable-close-button'
);
expect
(
CloseReopenReportToggle
.
default
).
toHaveBeenCalledWith
({
dropdownTrigger
,
dropdownList
,
button
,
});
expect
(
closeReopenReportToggle
.
initDroplab
).
toHaveBeenCalled
();
expect
(
CloseReopenReportToggle
.
prototype
.
initDroplab
).
toHaveBeenCalled
();
});
});
});
...
...
spec/javascripts/merge_request_spec.js
View file @
001c904f
...
...
@@ -2,7 +2,7 @@
/* global MergeRequest */
import
'~/merge_request'
;
import
*
as
CloseReopenReportToggle
from
'~/close_reopen_report_toggle'
;
import
CloseReopenReportToggle
from
'~/close_reopen_report_toggle'
;
(
function
()
{
describe
(
'MergeRequest'
,
function
()
{
...
...
@@ -40,15 +40,14 @@ import * as CloseReopenReportToggle from '~/close_reopen_report_toggle';
});
describe
(
'initCloseReopenReport'
,
()
=>
{
it
(
'
inits a new CloseReopenReportToggle instance and
calls .initDroplab'
,
()
=>
{
it
(
'calls .initDroplab'
,
()
=>
{
const
container
=
jasmine
.
createSpyObj
(
'container'
,
[
'querySelector'
]);
const
closeReopenReportToggle
=
jasmine
.
createSpyObj
(
'closeReopenReportToggle'
,
[
'initDroplab'
]);
const
dropdownTrigger
=
{};
const
dropdownList
=
{};
const
button
=
{};
spyOn
(
CloseReopenReportToggle
.
prototype
,
'initDroplab'
);
spyOn
(
document
,
'querySelector'
).
and
.
returnValue
(
container
);
spyOn
(
CloseReopenReportToggle
,
'default'
).
and
.
returnValue
(
closeReopenReportToggle
);
container
.
querySelector
.
and
.
returnValues
(
dropdownTrigger
,
dropdownList
,
button
);
MergeRequest
.
initCloseReopenReport
();
...
...
@@ -57,12 +56,7 @@ import * as CloseReopenReportToggle from '~/close_reopen_report_toggle';
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'.js-issuable-close-toggle'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'.js-issuable-close-menu'
);
expect
(
container
.
querySelector
).
toHaveBeenCalledWith
(
'.js-issuable-close-button'
);
expect
(
CloseReopenReportToggle
.
default
).
toHaveBeenCalledWith
({
dropdownTrigger
,
dropdownList
,
button
,
});
expect
(
closeReopenReportToggle
.
initDroplab
).
toHaveBeenCalled
();
expect
(
CloseReopenReportToggle
.
prototype
.
initDroplab
).
toHaveBeenCalled
();
});
});
});
...
...
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