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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9bb6c825
Commit
9bb6c825
authored
Apr 20, 2020
by
Scott Stern
Committed by
Mike Greiling
Apr 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace all instances of underscore to lodash in ee/spec
parent
f4b5ccd1
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
34 additions
and
34 deletions
+34
-34
ee/app/assets/javascripts/roadmap/components/epic_item.vue
ee/app/assets/javascripts/roadmap/components/epic_item.vue
+2
-2
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
+1
-1
ee/spec/frontend/analytics/cycle_analytics/utils_spec.js
ee/spec/frontend/analytics/cycle_analytics/utils_spec.js
+1
-1
ee/spec/frontend/feature_flags/components/form_spec.js
ee/spec/frontend/feature_flags/components/form_spec.js
+4
-4
ee/spec/frontend/feature_flags/store/helpers_spec.js
ee/spec/frontend/feature_flags/store/helpers_spec.js
+11
-13
ee/spec/frontend/ide/stores/modules/terminal/messages_spec.js
...pec/frontend/ide/stores/modules/terminal/messages_spec.js
+2
-2
ee/spec/frontend/roadmap/components/epic_item_spec.js
ee/spec/frontend/roadmap/components/epic_item_spec.js
+9
-3
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
...e_mr_widget/components/approvals/approvals_footer_spec.js
+1
-2
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_list_spec.js
...vue_mr_widget/components/approvals/approvals_list_spec.js
+1
-2
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_summary_spec.js
..._mr_widget/components/approvals/approvals_summary_spec.js
+1
-2
ee/spec/frontend/vue_shared/components/accordion/accordion_item_spec.js
...nd/vue_shared/components/accordion/accordion_item_spec.js
+1
-2
No files found.
ee/app/assets/javascripts/roadmap/components/epic_item.vue
View file @
9bb6c825
<
script
>
<
script
>
import
_
from
'
underscore
'
;
import
{
delay
}
from
'
lodash
'
;
import
epicItemDetails
from
'
./epic_item_details.vue
'
;
import
epicItemDetails
from
'
./epic_item_details.vue
'
;
import
epicItemTimeline
from
'
./epic_item_timeline.vue
'
;
import
epicItemTimeline
from
'
./epic_item_timeline.vue
'
;
...
@@ -78,7 +78,7 @@ export default {
...
@@ -78,7 +78,7 @@ export default {
removeHighlight
()
{
removeHighlight
()
{
if
(
this
.
epic
.
newEpic
)
{
if
(
this
.
epic
.
newEpic
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
_
.
delay
(()
=>
{
delay
(()
=>
{
this
.
epic
.
newEpic
=
false
;
this
.
epic
.
newEpic
=
false
;
},
EPIC_HIGHLIGHT_REMOVE_AFTER
);
},
EPIC_HIGHLIGHT_REMOVE_AFTER
);
});
});
...
...
ee/spec/frontend/analytics/cycle_analytics/mock_data.js
View file @
9bb6c825
import
{
uniq
}
from
'
underscore
'
;
import
{
uniq
}
from
'
lodash
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
{
getJSONFixture
}
from
'
helpers/fixtures
'
;
import
mutations
from
'
ee/analytics/cycle_analytics/store/mutations
'
;
import
mutations
from
'
ee/analytics/cycle_analytics/store/mutations
'
;
...
...
ee/spec/frontend/analytics/cycle_analytics/utils_spec.js
View file @
9bb6c825
import
{
isNumber
}
from
'
underscore
'
;
import
{
isNumber
}
from
'
lodash
'
;
import
{
getDatesInRange
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
getDatesInRange
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
import
{
isStartEvent
,
isStartEvent
,
...
...
ee/spec/frontend/feature_flags/components/form_spec.js
View file @
9bb6c825
import
_
from
'
underscore
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlFormTextarea
,
GlFormCheckbox
,
GlDeprecatedButton
}
from
'
@gitlab/ui
'
;
import
{
GlFormTextarea
,
GlFormCheckbox
,
GlDeprecatedButton
}
from
'
@gitlab/ui
'
;
import
Form
from
'
ee/feature_flags/components/form.vue
'
;
import
Form
from
'
ee/feature_flags/components/form.vue
'
;
...
@@ -156,7 +156,7 @@ describe('feature flag form', () => {
...
@@ -156,7 +156,7 @@ describe('feature flag form', () => {
it
(
'
should update the scope
'
,
()
=>
{
it
(
'
should update the scope
'
,
()
=>
{
wrapper
.
find
(
ToggleButton
).
vm
.
$emit
(
'
change
'
,
false
);
wrapper
.
find
(
ToggleButton
).
vm
.
$emit
(
'
change
'
,
false
);
expect
(
_
.
first
(
wrapper
.
vm
.
formScopes
)
.
active
).
toBe
(
false
);
expect
(
wrapper
.
vm
.
formScopes
[
0
]
.
active
).
toBe
(
false
);
});
});
it
(
'
should be disabled if the feature flag is not active
'
,
done
=>
{
it
(
'
should be disabled if the feature flag is not active
'
,
done
=>
{
...
@@ -185,7 +185,7 @@ describe('feature flag form', () => {
...
@@ -185,7 +185,7 @@ describe('feature flag form', () => {
});
});
it
(
'
should add `shouldBeDestroyed` key the clicked scope
'
,
()
=>
{
it
(
'
should add `shouldBeDestroyed` key the clicked scope
'
,
()
=>
{
expect
(
_
.
first
(
wrapper
.
vm
.
formScopes
)
.
shouldBeDestroyed
).
toBe
(
true
);
expect
(
wrapper
.
vm
.
formScopes
[
0
]
.
shouldBeDestroyed
).
toBe
(
true
);
});
});
it
(
'
should not render deleted scopes
'
,
()
=>
{
it
(
'
should not render deleted scopes
'
,
()
=>
{
...
@@ -203,7 +203,7 @@ describe('feature flag form', () => {
...
@@ -203,7 +203,7 @@ describe('feature flag form', () => {
{
{
environmentScope
:
'
new_scope
'
,
environmentScope
:
'
new_scope
'
,
active
:
false
,
active
:
false
,
id
:
_
.
uniqueId
(
INTERNAL_ID_PREFIX
),
id
:
uniqueId
(
INTERNAL_ID_PREFIX
),
canUpdate
:
true
,
canUpdate
:
true
,
protected
:
false
,
protected
:
false
,
strategies
:
[
strategies
:
[
...
...
ee/spec/frontend/feature_flags/store/helpers_spec.js
View file @
9bb6c825
import
_
from
'
underscore
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
import
{
mapToScopesViewModel
,
mapToScopesViewModel
,
mapFromScopesViewModel
,
mapFromScopesViewModel
,
...
@@ -214,7 +214,7 @@ describe('feature flags helpers spec', () => {
...
@@ -214,7 +214,7 @@ describe('feature flags helpers spec', () => {
it
(
'
should strip out internal IDs
'
,
()
=>
{
it
(
'
should strip out internal IDs
'
,
()
=>
{
const
input
=
{
const
input
=
{
scopes
:
[{
id
:
3
},
{
id
:
_
.
uniqueId
(
INTERNAL_ID_PREFIX
)
}],
scopes
:
[{
id
:
3
},
{
id
:
uniqueId
(
INTERNAL_ID_PREFIX
)
}],
};
};
const
result
=
mapFromScopesViewModel
(
input
);
const
result
=
mapFromScopesViewModel
(
input
);
...
@@ -380,16 +380,14 @@ describe('feature flags helpers spec', () => {
...
@@ -380,16 +380,14 @@ describe('feature flags helpers spec', () => {
});
});
it
(
'
inserts spaces between user ids
'
,
()
=>
{
it
(
'
inserts spaces between user ids
'
,
()
=>
{
const
strategy
=
_
.
first
(
const
strategy
=
mapStrategiesToViewModel
([
mapStrategiesToViewModel
([
{
{
id
:
'
1
'
,
id
:
'
1
'
,
name
:
'
userWithId
'
,
name
:
'
userWithId
'
,
parameters
:
{
userIds
:
'
user1,user2,user3
'
},
parameters
:
{
userIds
:
'
user1,user2,user3
'
},
scopes
:
[],
scopes
:
[],
},
},
])[
0
];
]),
);
expect
(
strategy
.
parameters
).
toEqual
({
userIds
:
'
user1, user2, user3
'
});
expect
(
strategy
.
parameters
).
toEqual
({
userIds
:
'
user1, user2, user3
'
});
});
});
...
@@ -492,7 +490,7 @@ describe('feature flags helpers spec', () => {
...
@@ -492,7 +490,7 @@ describe('feature flags helpers spec', () => {
],
],
});
});
const
strategyAttrs
=
_
.
first
(
result
.
operations_feature_flag
.
strategies_attributes
)
;
const
strategyAttrs
=
result
.
operations_feature_flag
.
strategies_attributes
[
0
]
;
expect
(
strategyAttrs
.
parameters
).
toEqual
({
userIds
:
'
user1,user2,user3
'
});
expect
(
strategyAttrs
.
parameters
).
toEqual
({
userIds
:
'
user1,user2,user3
'
});
});
});
...
...
ee/spec/frontend/ide/stores/modules/terminal/messages_spec.js
View file @
9bb6c825
import
_
from
'
underscore
'
;
import
{
escape
as
esc
}
from
'
lodash
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
*
as
messages
from
'
ee/ide/stores/modules/terminal/messages
'
;
import
*
as
messages
from
'
ee/ide/stores/modules/terminal/messages
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
...
@@ -15,7 +15,7 @@ describe('EE IDE store terminal messages', () => {
...
@@ -15,7 +15,7 @@ describe('EE IDE store terminal messages', () => {
sprintf
(
sprintf
(
messages
.
ERROR_CONFIG
,
messages
.
ERROR_CONFIG
,
{
{
helpStart
:
`<a href="
${
_
.
escape
(
TEST_HELP_URL
)}
" target="_blank">`
,
helpStart
:
`<a href="
${
esc
(
TEST_HELP_URL
)}
" target="_blank">`
,
helpEnd
:
'
</a>
'
,
helpEnd
:
'
</a>
'
,
},
},
false
,
false
,
...
...
ee/spec/frontend/roadmap/components/epic_item_spec.js
View file @
9bb6c825
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
_
from
'
underscore
'
;
import
_
from
'
lodash
'
;
import
epicItemComponent
from
'
ee/roadmap/components/epic_item.vue
'
;
import
epicItemComponent
from
'
ee/roadmap/components/epic_item.vue
'
;
...
@@ -11,6 +11,14 @@ import { PRESET_TYPES } from 'ee/roadmap/constants';
...
@@ -11,6 +11,14 @@ import { PRESET_TYPES } from 'ee/roadmap/constants';
import
mountComponent
from
'
helpers/vue_mount_component_helper
'
;
import
mountComponent
from
'
helpers/vue_mount_component_helper
'
;
import
{
mockTimeframeInitialDate
,
mockEpic
,
mockGroupId
}
from
'
ee_jest/roadmap/mock_data
'
;
import
{
mockTimeframeInitialDate
,
mockEpic
,
mockGroupId
}
from
'
ee_jest/roadmap/mock_data
'
;
jest
.
mock
(
'
lodash/delay
'
,
()
=>
jest
.
fn
(
func
=>
{
// eslint-disable-next-line no-param-reassign
func
.
delay
=
jest
.
fn
();
return
func
;
}),
);
const
mockTimeframeMonths
=
getTimeframeForMonthsView
(
mockTimeframeInitialDate
);
const
mockTimeframeMonths
=
getTimeframeForMonthsView
(
mockTimeframeInitialDate
);
const
createComponent
=
({
const
createComponent
=
({
...
@@ -111,8 +119,6 @@ describe('EpicItemComponent', () => {
...
@@ -111,8 +119,6 @@ describe('EpicItemComponent', () => {
describe
(
'
methods
'
,
()
=>
{
describe
(
'
methods
'
,
()
=>
{
describe
(
'
removeHighlight
'
,
()
=>
{
describe
(
'
removeHighlight
'
,
()
=>
{
it
(
'
should call _.delay after 3 seconds with a callback function which would set `epic.newEpic` to false when it is true already
'
,
done
=>
{
it
(
'
should call _.delay after 3 seconds with a callback function which would set `epic.newEpic` to false when it is true already
'
,
done
=>
{
jest
.
spyOn
(
_
,
'
delay
'
).
mockImplementation
(()
=>
{});
vm
.
epic
.
newEpic
=
true
;
vm
.
epic
.
newEpic
=
true
;
vm
.
removeHighlight
();
vm
.
removeHighlight
();
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_footer_spec.js
View file @
9bb6c825
import
_
from
'
underscore
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlDeprecatedButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlDeprecatedButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
ApprovalsList
from
'
ee/vue_merge_request_widget/components/approvals/approvals_list.vue
'
;
import
ApprovalsList
from
'
ee/vue_merge_request_widget/components/approvals/approvals_list.vue
'
;
...
@@ -6,7 +5,7 @@ import ApprovalsFooter from 'ee/vue_merge_request_widget/components/approvals/ap
...
@@ -6,7 +5,7 @@ import ApprovalsFooter from 'ee/vue_merge_request_widget/components/approvals/ap
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
const
testSuggestedApprovers
=
()
=>
_
.
range
(
1
,
11
).
map
(
id
=>
({
id
}));
const
testSuggestedApprovers
=
()
=>
Array
.
from
({
length
:
11
},
(
_
,
i
)
=>
i
).
map
(
id
=>
({
id
}));
const
testApprovalRules
=
()
=>
[{
name
:
'
Lorem
'
},
{
name
:
'
Ipsum
'
}];
const
testApprovalRules
=
()
=>
[{
name
:
'
Lorem
'
},
{
name
:
'
Ipsum
'
}];
describe
(
'
EE MRWidget approvals footer
'
,
()
=>
{
describe
(
'
EE MRWidget approvals footer
'
,
()
=>
{
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_list_spec.js
View file @
9bb6c825
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
_
from
'
underscore
'
;
import
ApprovedIcon
from
'
ee/vue_merge_request_widget/components/approvals/approved_icon.vue
'
;
import
ApprovedIcon
from
'
ee/vue_merge_request_widget/components/approvals/approved_icon.vue
'
;
import
ApprovalsList
from
'
ee/vue_merge_request_widget/components/approvals/approvals_list.vue
'
;
import
ApprovalsList
from
'
ee/vue_merge_request_widget/components/approvals/approvals_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
const
testApprovers
=
()
=>
_
.
range
(
1
,
11
).
map
(
id
=>
({
id
}));
const
testApprovers
=
()
=>
Array
.
from
({
length
:
11
},
(
_
,
i
)
=>
i
).
map
(
id
=>
({
id
}));
const
testRuleApproved
=
()
=>
({
const
testRuleApproved
=
()
=>
({
id
:
1
,
id
:
1
,
name
:
'
Lorem
'
,
name
:
'
Lorem
'
,
...
...
ee/spec/frontend/vue_mr_widget/components/approvals/approvals_summary_spec.js
View file @
9bb6c825
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
_
from
'
underscore
'
;
import
{
APPROVED_MESSAGE
}
from
'
ee/vue_merge_request_widget/components/approvals/messages
'
;
import
{
APPROVED_MESSAGE
}
from
'
ee/vue_merge_request_widget/components/approvals/messages
'
;
import
ApprovalsSummary
from
'
ee/vue_merge_request_widget/components/approvals/approvals_summary.vue
'
;
import
ApprovalsSummary
from
'
ee/vue_merge_request_widget/components/approvals/approvals_summary.vue
'
;
import
{
toNounSeriesText
}
from
'
~/lib/utils/grammar
'
;
import
{
toNounSeriesText
}
from
'
~/lib/utils/grammar
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
import
UserAvatarList
from
'
~/vue_shared/components/user_avatar/user_avatar_list.vue
'
;
const
testApprovers
=
()
=>
_
.
range
(
1
,
5
).
map
(
id
=>
({
id
}));
const
testApprovers
=
()
=>
Array
.
from
({
length
:
5
},
(
_
,
i
)
=>
i
).
map
(
id
=>
({
id
}));
const
testRulesLeft
=
()
=>
[
'
Lorem
'
,
'
Ipsum
'
,
'
dolar sit
'
];
const
testRulesLeft
=
()
=>
[
'
Lorem
'
,
'
Ipsum
'
,
'
dolar sit
'
];
const
TEST_APPROVALS_LEFT
=
3
;
const
TEST_APPROVALS_LEFT
=
3
;
...
...
ee/spec/frontend/vue_shared/components/accordion/accordion_item_spec.js
View file @
9bb6c825
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
uniqueId
}
from
'
lodash
'
;
import
{
AccordionItem
}
from
'
ee/vue_shared/components/accordion
'
;
import
{
AccordionItem
}
from
'
ee/vue_shared/components/accordion
'
;
import
accordionEventBus
from
'
ee/vue_shared/components/accordion/accordion_event_bus
'
;
import
accordionEventBus
from
'
ee/vue_shared/components/accordion/accordion_event_bus
'
;
import
{
uniqueId
}
from
'
lodash
'
;
jest
.
mock
(
'
ee/vue_shared/components/accordion/accordion_event_bus
'
,
()
=>
({
jest
.
mock
(
'
ee/vue_shared/components/accordion/accordion_event_bus
'
,
()
=>
({
$on
:
jest
.
fn
(),
$on
:
jest
.
fn
(),
...
...
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