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
a223014a
Commit
a223014a
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 29 spec files: 10 of 10
Mandatory not to break master. Automatically created with prettier.
parent
482d756c
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
114 additions
and
228 deletions
+114
-228
.prettierignore
.prettierignore
+0
-8
spec/frontend/vue_shared/components/awards_list_spec.js
spec/frontend/vue_shared/components/awards_list_spec.js
+2
-6
spec/frontend/vue_shared/components/color_picker/color_picker_spec.js
...d/vue_shared/components/color_picker/color_picker_spec.js
+1
-3
spec/frontend/vue_shared/components/commit_spec.js
spec/frontend/vue_shared/components/commit_spec.js
+1
-6
spec/frontend/vue_shared/components/expand_button_spec.js
spec/frontend/vue_shared/components/expand_button_spec.js
+7
-42
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_utils_spec.js
...ponents/filtered_search_bar/filtered_search_utils_spec.js
+42
-9
spec/frontend/vue_shared/components/filtered_search_bar/mock_data.js
...nd/vue_shared/components/filtered_search_bar/mock_data.js
+4
-1
spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js
...components/filtered_search_bar/tokens/label_token_spec.js
+3
-6
spec/frontend/vue_shared/components/filtered_search_bar/tokens/milestone_token_spec.js
...onents/filtered_search_bar/tokens/milestone_token_spec.js
+4
-1
spec/frontend/vue_shared/components/gl_countdown_spec.js
spec/frontend/vue_shared/components/gl_countdown_spec.js
+2
-6
spec/frontend/vue_shared/components/issue/related_issuable_item_spec.js
...vue_shared/components/issue/related_issuable_item_spec.js
+1
-3
spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
...ue_shared/components/markdown/suggestion_diff_row_spec.js
+1
-5
spec/frontend/vue_shared/components/paginated_table_with_search_and_tabs/paginated_table_with_search_and_tabs_spec.js
...rch_and_tabs/paginated_table_with_search_and_tabs_spec.js
+6
-13
spec/frontend/vue_shared/components/registry/title_area_spec.js
...rontend/vue_shared/components/registry/title_area_spec.js
+2
-10
spec/frontend/vue_shared/components/sidebar/date_picker_spec.js
...rontend/vue_shared/components/sidebar/date_picker_spec.js
+5
-30
spec/frontend/vue_shared/components/sidebar/issuable_move_dropdown_spec.js
..._shared/components/sidebar/issuable_move_dropdown_spec.js
+6
-26
spec/frontend/vue_shared/components/sidebar/labels_select/dropdown_value_spec.js
...d/components/sidebar/labels_select/dropdown_value_spec.js
+1
-6
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js
...r/labels_select_vue/dropdown_contents_create_view_spec.js
+4
-16
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js
...r/labels_select_vue/dropdown_contents_labels_view_spec.js
+1
-3
spec/frontend/vue_shared/components/sidebar/labels_select_vue/store/getters_spec.js
...omponents/sidebar/labels_select_vue/store/getters_spec.js
+4
-1
spec/frontend/vue_shared/components/split_button_spec.js
spec/frontend/vue_shared/components/split_button_spec.js
+1
-4
spec/frontend/vue_shared/directives/tooltip_spec.js
spec/frontend/vue_shared/directives/tooltip_spec.js
+1
-5
spec/frontend_integration/ide/helpers/ide_helper.js
spec/frontend_integration/ide/helpers/ide_helper.js
+1
-4
spec/frontend_integration/test_helpers/factories/commit_id.js
.../frontend_integration/test_helpers/factories/commit_id.js
+1
-3
spec/frontend_integration/test_helpers/utils/obj_spec.js
spec/frontend_integration/test_helpers/utils/obj_spec.js
+3
-3
spec/javascripts/fly_out_nav_browser_spec.js
spec/javascripts/fly_out_nav_browser_spec.js
+3
-2
spec/javascripts/lib/utils/browser_spec.js
spec/javascripts/lib/utils/browser_spec.js
+1
-1
spec/javascripts/matchers.js
spec/javascripts/matchers.js
+3
-2
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+3
-3
No files found.
.prettierignore
View file @
a223014a
...
...
@@ -9,11 +9,3 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.css
*.scss
*.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
spec/frontend/vue_shared/components
spec/frontend/vue_shared/directives
spec/frontend_integration/ide/helpers
spec/frontend_integration/test_helpers/factories
spec/frontend_integration/test_helpers/utils
spec/javascripts
spec/frontend/vue_shared/components/awards_list_spec.js
View file @
a223014a
...
...
@@ -135,9 +135,7 @@ describe('vue_shared/components/awards_list', () => {
it
(
'
with award clicked, it emits award
'
,
()
=>
{
expect
(
wrapper
.
emitted
().
award
).
toBeUndefined
();
findAwardButtons
()
.
at
(
2
)
.
vm
.
$emit
(
'
click
'
);
findAwardButtons
().
at
(
2
).
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
emitted
().
award
).
toEqual
([[
EMOJI_SMILE
]]);
});
...
...
@@ -162,9 +160,7 @@ describe('vue_shared/components/awards_list', () => {
it
(
'
when clicked, it emits award as number
'
,
()
=>
{
expect
(
wrapper
.
emitted
().
award
).
toBeUndefined
();
findAwardButtons
()
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
);
findAwardButtons
().
at
(
0
).
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
emitted
().
award
).
toEqual
([[
Number
(
EMOJI_100
)]]);
});
...
...
spec/frontend/vue_shared/components/color_picker/color_picker_spec.js
View file @
a223014a
...
...
@@ -130,9 +130,7 @@ describe('ColorPicker', () => {
it
(
'
has preset color selected
'
,
async
()
=>
{
createComponent
();
await
presetColors
()
.
at
(
0
)
.
trigger
(
'
click
'
);
await
presetColors
().
at
(
0
).
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
$data
.
selectedColor
).
toBe
(
setColor
);
});
...
...
spec/frontend/vue_shared/components/commit_spec.js
View file @
a223014a
...
...
@@ -43,12 +43,7 @@ describe('Commit component', () => {
},
});
expect
(
wrapper
.
find
(
'
.icon-container
'
)
.
find
(
GlIcon
)
.
exists
(),
).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.icon-container
'
).
find
(
GlIcon
).
exists
()).
toBe
(
true
);
});
describe
(
'
Given all the props
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/expand_button_spec.js
View file @
a223014a
...
...
@@ -41,12 +41,7 @@ describe('Expand button', () => {
});
it
(
'
does not render expanded text
'
,
()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
not
.
toBe
(
text
.
short
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
not
.
toBe
(
text
.
short
);
});
describe
(
'
when short text is provided
'
,
()
=>
{
...
...
@@ -60,12 +55,7 @@ describe('Expand button', () => {
});
it
(
'
renders short text
'
,
()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
toBe
(
text
.
short
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
toBe
(
text
.
short
);
});
it
(
'
renders button before text
'
,
()
=>
{
...
...
@@ -108,12 +98,7 @@ describe('Expand button', () => {
});
it
(
'
only renders expanded text
'
,
()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
toBe
(
text
.
expanded
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
toBe
(
text
.
expanded
);
});
it
(
'
renders button after text
'
,
()
=>
{
...
...
@@ -140,21 +125,11 @@ describe('Expand button', () => {
});
it
(
'
clicking hides expanded text
'
,
()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
toBe
(
text
.
expanded
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
toBe
(
text
.
expanded
);
expanderAppendEl
().
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
not
.
toBe
(
text
.
expanded
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
not
.
toBe
(
text
.
expanded
);
});
});
...
...
@@ -172,21 +147,11 @@ describe('Expand button', () => {
});
it
(
'
clicking reveals short text
'
,
()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
toBe
(
text
.
expanded
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
toBe
(
text
.
expanded
);
expanderAppendEl
().
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
find
(
ExpandButton
)
.
text
()
.
trim
(),
).
toBe
(
text
.
short
);
expect
(
wrapper
.
find
(
ExpandButton
).
text
().
trim
()).
toBe
(
text
.
short
);
});
});
});
...
...
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_utils_spec.js
View file @
a223014a
...
...
@@ -82,7 +82,10 @@ describe('prepareTokens', () => {
],
[
'
assignees
'
,
[{
value
:
'
krillin
'
,
operator
:
'
=
'
},
{
value
:
'
piccolo
'
,
operator
:
'
!=
'
}],
[
{
value
:
'
krillin
'
,
operator
:
'
=
'
},
{
value
:
'
piccolo
'
,
operator
:
'
!=
'
},
],
[
{
type
:
'
assignees
'
,
value
:
{
data
:
'
krillin
'
,
operator
:
'
=
'
}
},
{
type
:
'
assignees
'
,
value
:
{
data
:
'
piccolo
'
,
operator
:
'
!=
'
}
},
...
...
@@ -90,7 +93,10 @@ describe('prepareTokens', () => {
],
[
'
foo
'
,
[{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
!=
'
}],
[
{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
!=
'
},
],
[
{
type
:
'
foo
'
,
value
:
{
data
:
'
bar
'
,
operator
:
'
!=
'
}
},
{
type
:
'
foo
'
,
value
:
{
data
:
'
baz
'
,
operator
:
'
!=
'
}
},
...
...
@@ -112,7 +118,10 @@ describe('processFilters', () => {
expect
(
result
).
toStrictEqual
({
foo
:
[{
value
:
'
foo
'
,
operator
:
'
=
'
}],
bar
:
[{
value
:
'
bar1
'
,
operator
:
'
=
'
},
{
value
:
'
bar2
'
,
operator
:
'
!=
'
}],
bar
:
[
{
value
:
'
bar1
'
,
operator
:
'
=
'
},
{
value
:
'
bar2
'
,
operator
:
'
!=
'
},
],
});
});
...
...
@@ -164,17 +173,26 @@ describe('filterToQueryObject', () => {
],
[
'
foo
'
,
[{
value
:
'
bar
'
,
operator
:
'
=
'
},
{
value
:
'
baz
'
,
operator
:
'
=
'
}],
[
{
value
:
'
bar
'
,
operator
:
'
=
'
},
{
value
:
'
baz
'
,
operator
:
'
=
'
},
],
{
foo
:
[
'
bar
'
,
'
baz
'
],
'
not[foo]
'
:
null
},
],
[
'
foo
'
,
[{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
!=
'
}],
[
{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
!=
'
},
],
{
foo
:
null
,
'
not[foo]
'
:
[
'
bar
'
,
'
baz
'
]
},
],
[
'
foo
'
,
[{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
=
'
}],
[
{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
=
'
},
],
{
foo
:
[
'
baz
'
],
'
not[foo]
'
:
[
'
bar
'
]
},
],
])(
'
gathers filter values %s=%j into query object=%j
'
,
(
token
,
value
,
result
)
=>
{
...
...
@@ -200,15 +218,30 @@ describe('urlQueryToFilter', () => {
[
'
not[foo]=bar&foo=baz
'
,
{
foo
:
{
value
:
'
baz
'
,
operator
:
'
=
'
}
}],
[
'
foo[]=bar&foo[]=baz¬[foo]=
'
,
{
foo
:
[{
value
:
'
bar
'
,
operator
:
'
=
'
},
{
value
:
'
baz
'
,
operator
:
'
=
'
}]
},
{
foo
:
[
{
value
:
'
bar
'
,
operator
:
'
=
'
},
{
value
:
'
baz
'
,
operator
:
'
=
'
},
],
},
],
[
'
foo[]=¬[foo][]=bar¬[foo][]=baz
'
,
{
foo
:
[{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
!=
'
}]
},
{
foo
:
[
{
value
:
'
bar
'
,
operator
:
'
!=
'
},
{
value
:
'
baz
'
,
operator
:
'
!=
'
},
],
},
],
[
'
foo[]=baz¬[foo][]=bar
'
,
{
foo
:
[{
value
:
'
baz
'
,
operator
:
'
=
'
},
{
value
:
'
bar
'
,
operator
:
'
!=
'
}]
},
{
foo
:
[
{
value
:
'
baz
'
,
operator
:
'
=
'
},
{
value
:
'
bar
'
,
operator
:
'
!=
'
},
],
},
],
[
'
not[foo][]=bar
'
,
{
foo
:
[{
value
:
'
bar
'
,
operator
:
'
!=
'
}]
}],
])(
'
gathers filter values %s into query object=%j
'
,
(
query
,
result
)
=>
{
...
...
spec/frontend/vue_shared/components/filtered_search_bar/mock_data.js
View file @
a223014a
...
...
@@ -110,7 +110,10 @@ export const mockMembershipToken = {
token
:
GlFilteredSearchToken
,
unique
:
true
,
operators
:
[{
value
:
'
=
'
,
description
:
'
is
'
}],
options
:
[{
value
:
'
exclude
'
,
title
:
'
Direct
'
},
{
value
:
'
only
'
,
title
:
'
Inherited
'
}],
options
:
[
{
value
:
'
exclude
'
,
title
:
'
Direct
'
},
{
value
:
'
only
'
,
title
:
'
Inherited
'
},
],
};
export
const
mockMembershipTokenOptionsWithoutTitles
=
{
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js
View file @
a223014a
...
...
@@ -181,12 +181,9 @@ describe('LabelToken', () => {
expect
(
tokenSegments
).
toHaveLength
(
3
);
// Label, =, "Foo Label"
expect
(
tokenSegments
.
at
(
2
).
text
()).
toBe
(
`~
${
mockRegularLabel
.
title
}
`
);
// "Foo Label"
expect
(
tokenSegments
.
at
(
2
)
.
find
(
'
.gl-token
'
)
.
attributes
(
'
style
'
),
).
toBe
(
'
background-color: rgb(186, 218, 85); color: rgb(255, 255, 255);
'
);
expect
(
tokenSegments
.
at
(
2
).
find
(
'
.gl-token
'
).
attributes
(
'
style
'
)).
toBe
(
'
background-color: rgb(186, 218, 85); color: rgb(255, 255, 255);
'
,
);
});
it
(
'
renders provided defaultLabels as suggestions
'
,
async
()
=>
{
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/milestone_token_spec.js
View file @
a223014a
...
...
@@ -140,7 +140,10 @@ describe('MilestoneToken', () => {
});
describe
(
'
template
'
,
()
=>
{
const
defaultMilestones
=
[{
text
:
'
foo
'
,
value
:
'
foo
'
},
{
text
:
'
bar
'
,
value
:
'
baz
'
}];
const
defaultMilestones
=
[
{
text
:
'
foo
'
,
value
:
'
foo
'
},
{
text
:
'
bar
'
,
value
:
'
baz
'
},
];
beforeEach
(
async
()
=>
{
wrapper
=
createComponent
({
value
:
{
data
:
`"
${
mockRegularMilestone
.
title
}
"`
}
});
...
...
spec/frontend/vue_shared/components/gl_countdown_spec.js
View file @
a223014a
...
...
@@ -22,9 +22,7 @@ describe('GlCountdown', () => {
endDateString
:
'
2000-01-01T01:02:03Z
'
,
});
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
Vue
.
nextTick
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
displays remaining time
'
,
()
=>
{
...
...
@@ -50,9 +48,7 @@ describe('GlCountdown', () => {
endDateString
:
'
1900-01-01T00:00:00Z
'
,
});
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
Vue
.
nextTick
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
displays 00:00:00
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/issue/related_issuable_item_spec.js
View file @
a223014a
...
...
@@ -115,9 +115,7 @@ describe('RelatedIssuableItem', () => {
const
tokenMetadata
=
()
=>
wrapper
.
find
(
'
.item-meta
'
);
it
(
'
renders item path and ID
'
,
()
=>
{
const
pathAndID
=
tokenMetadata
()
.
find
(
'
.item-path-id
'
)
.
text
();
const
pathAndID
=
tokenMetadata
().
find
(
'
.item-path-id
'
).
text
();
expect
(
pathAndID
).
toContain
(
'
gitlab-org/gitlab-test
'
);
expect
(
pathAndID
).
toContain
(
'
#1
'
);
...
...
spec/frontend/vue_shared/components/markdown/suggestion_diff_row_spec.js
View file @
a223014a
...
...
@@ -61,11 +61,7 @@ describe('SuggestionDiffRow', () => {
});
expect
(
wrapper
.
classes
()).
toContain
(
'
line_holder
'
);
expect
(
findSuggestionContent
()
.
find
(
'
span
'
)
.
classes
(),
).
toContain
(
'
line
'
);
expect
(
findSuggestionContent
().
find
(
'
span
'
).
classes
()).
toContain
(
'
line
'
);
});
it
(
'
renders the rich text when it is available
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/paginated_table_with_search_and_tabs/paginated_table_with_search_and_tabs_spec.js
View file @
a223014a
...
...
@@ -124,7 +124,10 @@ describe('AlertManagementEmptyState', () => {
it
(
'
renders the tabs selection with valid tabs
'
,
()
=>
{
mountComponent
({
props
:
{
statusTabs
:
[{
status
:
'
opened
'
,
title
:
'
Open
'
},
{
status
:
'
closed
'
,
title
:
'
Closed
'
}],
statusTabs
:
[
{
status
:
'
opened
'
,
title
:
'
Open
'
},
{
status
:
'
closed
'
,
title
:
'
Closed
'
},
],
},
});
...
...
@@ -216,12 +219,7 @@ describe('AlertManagementEmptyState', () => {
findPagination
().
vm
.
$emit
(
'
input
'
,
3
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
findPagination
()
.
findAll
(
'
.page-item
'
)
.
at
(
0
)
.
text
(),
).
toBe
(
'
Prev
'
);
expect
(
findPagination
().
findAll
(
'
.page-item
'
).
at
(
0
).
text
()).
toBe
(
'
Prev
'
);
});
it
(
'
returns prevPage number
'
,
async
()
=>
{
...
...
@@ -244,12 +242,7 @@ describe('AlertManagementEmptyState', () => {
findPagination
().
vm
.
$emit
(
'
input
'
,
3
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
findPagination
()
.
findAll
(
'
.page-item
'
)
.
at
(
1
)
.
text
(),
).
toBe
(
'
Next
'
);
expect
(
findPagination
().
findAll
(
'
.page-item
'
).
at
(
1
).
text
()).
toBe
(
'
Next
'
);
});
it
(
'
returns nextPage number
'
,
async
()
=>
{
...
...
spec/frontend/vue_shared/components/registry/title_area_spec.js
View file @
a223014a
...
...
@@ -142,16 +142,8 @@ describe('title area', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
findSlotOrderElements
()
.
at
(
0
)
.
attributes
(
'
data-testid
'
),
).
toBe
(
DYNAMIC_SLOT
);
expect
(
findSlotOrderElements
()
.
at
(
1
)
.
attributes
(
'
data-testid
'
),
).
toBe
(
'
metadata-foo
'
);
expect
(
findSlotOrderElements
().
at
(
0
).
attributes
(
'
data-testid
'
)).
toBe
(
DYNAMIC_SLOT
);
expect
(
findSlotOrderElements
().
at
(
1
).
attributes
(
'
data-testid
'
)).
toBe
(
'
metadata-foo
'
);
});
});
...
...
spec/frontend/vue_shared/components/sidebar/date_picker_spec.js
View file @
a223014a
...
...
@@ -46,12 +46,7 @@ describe('SidebarDatePicker', () => {
it
(
'
should render None if there is no selectedDate
'
,
()
=>
{
mountComponent
();
expect
(
wrapper
.
find
(
'
.value-content span
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
None
'
);
expect
(
wrapper
.
find
(
'
.value-content span
'
).
text
().
trim
()).
toEqual
(
'
None
'
);
});
it
(
'
should render date-picker when editing
'
,
()
=>
{
...
...
@@ -63,12 +58,7 @@ describe('SidebarDatePicker', () => {
it
(
'
should render label
'
,
()
=>
{
const
label
=
'
label
'
;
mountComponent
({
label
});
expect
(
wrapper
.
find
(
'
.title
'
)
.
text
()
.
trim
(),
).
toEqual
(
label
);
expect
(
wrapper
.
find
(
'
.title
'
).
text
().
trim
()).
toEqual
(
label
);
});
it
(
'
should render loading-icon when isLoading
'
,
()
=>
{
...
...
@@ -82,12 +72,7 @@ describe('SidebarDatePicker', () => {
});
it
(
'
should render edit button
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.title .btn-blank
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
Edit
'
);
expect
(
wrapper
.
find
(
'
.title .btn-blank
'
).
text
().
trim
()).
toEqual
(
'
Edit
'
);
});
it
(
'
should enable editing when edit button is clicked
'
,
async
()
=>
{
...
...
@@ -102,12 +87,7 @@ describe('SidebarDatePicker', () => {
it
(
'
should render date if selectedDate
'
,
()
=>
{
mountComponent
({
selectedDate
:
new
Date
(
'
07/07/2017
'
)
});
expect
(
wrapper
.
find
(
'
.value-content strong
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
Jul 7, 2017
'
);
expect
(
wrapper
.
find
(
'
.value-content strong
'
).
text
().
trim
()).
toEqual
(
'
Jul 7, 2017
'
);
});
describe
(
'
selectedDate and editable
'
,
()
=>
{
...
...
@@ -116,12 +96,7 @@ describe('SidebarDatePicker', () => {
});
it
(
'
should render remove button if selectedDate and editable
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.value-content .btn-blank
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
remove
'
);
expect
(
wrapper
.
find
(
'
.value-content .btn-blank
'
).
text
().
trim
()).
toEqual
(
'
remove
'
);
});
it
(
'
should emit saveDate with null when remove button is clicked
'
,
()
=>
{
...
...
spec/frontend/vue_shared/components/sidebar/issuable_move_dropdown_spec.js
View file @
a223014a
...
...
@@ -184,11 +184,7 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
renders gl-dropdown-form component
'
,
()
=>
{
expect
(
findDropdownEl
()
.
find
(
GlDropdownForm
)
.
exists
(),
).
toBe
(
true
);
expect
(
findDropdownEl
().
find
(
GlDropdownForm
).
exists
()).
toBe
(
true
);
});
it
(
'
renders header element
'
,
()
=>
{
...
...
@@ -216,11 +212,7 @@ describe('IssuableMoveDropdown', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
findDropdownEl
()
.
find
(
GlLoadingIcon
)
.
exists
(),
).
toBe
(
true
);
expect
(
findDropdownEl
().
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
it
(
'
renders gl-dropdown-item components for available projects
'
,
async
()
=>
{
...
...
@@ -288,10 +280,7 @@ describe('IssuableMoveDropdown', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
'
[data-testid="footer"]
'
)
.
find
(
GlButton
)
.
attributes
(
'
disabled
'
),
wrapper
.
find
(
'
[data-testid="footer"]
'
).
find
(
GlButton
).
attributes
(
'
disabled
'
),
).
not
.
toBeDefined
();
});
});
...
...
@@ -331,10 +320,7 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
close icon in dropdown header closes the dropdown when clicked
'
,
()
=>
{
wrapper
.
find
(
'
[data-testid="header"]
'
)
.
find
(
GlButton
)
.
vm
.
$emit
(
'
click
'
,
mockEvent
);
wrapper
.
find
(
'
[data-testid="header"]
'
).
find
(
GlButton
).
vm
.
$emit
(
'
click
'
,
mockEvent
);
expect
(
wrapper
.
vm
.
$refs
.
dropdown
.
hide
).
toHaveBeenCalled
();
});
...
...
@@ -346,10 +332,7 @@ describe('IssuableMoveDropdown', () => {
await
wrapper
.
vm
.
$nextTick
();
wrapper
.
findAll
(
GlDropdownItem
)
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
,
mockEvent
);
wrapper
.
findAll
(
GlDropdownItem
).
at
(
0
).
vm
.
$emit
(
'
click
'
,
mockEvent
);
expect
(
wrapper
.
vm
.
selectedProject
).
toBe
(
mockProjects
[
0
]);
});
...
...
@@ -361,10 +344,7 @@ describe('IssuableMoveDropdown', () => {
await
wrapper
.
vm
.
$nextTick
();
wrapper
.
find
(
'
[data-testid="footer"]
'
)
.
find
(
GlButton
)
.
vm
.
$emit
(
'
click
'
);
wrapper
.
find
(
'
[data-testid="footer"]
'
).
find
(
GlButton
).
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
vm
.
$refs
.
dropdown
.
hide
).
toHaveBeenCalled
();
expect
(
wrapper
.
emitted
(
'
move-issuable
'
)).
toBeTruthy
();
...
...
spec/frontend/vue_shared/components/sidebar/labels_select/dropdown_value_spec.js
View file @
a223014a
...
...
@@ -71,12 +71,7 @@ describe('DropdownValueComponent', () => {
it
(
'
render slot content inside component when `labels` prop is empty
'
,
()
=>
{
const
vmEmptyLabels
=
createComponent
([]);
expect
(
vmEmptyLabels
.
find
(
'
.text-secondary
'
)
.
text
()
.
trim
(),
).
toBe
(
mockConfig
.
emptyValueText
);
expect
(
vmEmptyLabels
.
find
(
'
.text-secondary
'
).
text
().
trim
()).
toBe
(
mockConfig
.
emptyValueText
);
vmEmptyLabels
.
destroy
();
});
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js
View file @
a223014a
...
...
@@ -125,10 +125,7 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
renders dropdown back button element
'
,
()
=>
{
const
backBtnEl
=
wrapper
.
find
(
'
.dropdown-title
'
)
.
findAll
(
GlButton
)
.
at
(
0
);
const
backBtnEl
=
wrapper
.
find
(
'
.dropdown-title
'
).
findAll
(
GlButton
).
at
(
0
);
expect
(
backBtnEl
.
exists
()).
toBe
(
true
);
expect
(
backBtnEl
.
attributes
(
'
aria-label
'
)).
toBe
(
'
Go back
'
);
...
...
@@ -143,10 +140,7 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
renders dropdown close button element
'
,
()
=>
{
const
closeBtnEl
=
wrapper
.
find
(
'
.dropdown-title
'
)
.
findAll
(
GlButton
)
.
at
(
1
);
const
closeBtnEl
=
wrapper
.
find
(
'
.dropdown-title
'
).
findAll
(
GlButton
).
at
(
1
);
expect
(
closeBtnEl
.
exists
()).
toBe
(
true
);
expect
(
closeBtnEl
.
attributes
(
'
aria-label
'
)).
toBe
(
'
Close
'
);
...
...
@@ -190,10 +184,7 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
renders create button element
'
,
()
=>
{
const
createBtnEl
=
wrapper
.
find
(
'
.dropdown-actions
'
)
.
findAll
(
GlButton
)
.
at
(
0
);
const
createBtnEl
=
wrapper
.
find
(
'
.dropdown-actions
'
).
findAll
(
GlButton
).
at
(
0
);
expect
(
createBtnEl
.
exists
()).
toBe
(
true
);
expect
(
createBtnEl
.
text
()).
toContain
(
'
Create
'
);
...
...
@@ -211,10 +202,7 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
renders cancel button element
'
,
()
=>
{
const
cancelBtnEl
=
wrapper
.
find
(
'
.dropdown-actions
'
)
.
findAll
(
GlButton
)
.
at
(
1
);
const
cancelBtnEl
=
wrapper
.
find
(
'
.dropdown-actions
'
).
findAll
(
GlButton
).
at
(
1
);
expect
(
cancelBtnEl
.
exists
()).
toBe
(
true
);
expect
(
cancelBtnEl
.
text
()).
toContain
(
'
Cancel
'
);
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js
View file @
a223014a
...
...
@@ -371,9 +371,7 @@ describe('DropdownContentsLabelsView', () => {
wrapper
.
vm
.
$store
.
state
.
allowLabelCreate
=
false
;
return
wrapper
.
vm
.
$nextTick
(()
=>
{
const
createLabelLink
=
findDropdownFooter
()
.
findAll
(
GlLink
)
.
at
(
0
);
const
createLabelLink
=
findDropdownFooter
().
findAll
(
GlLink
).
at
(
0
);
expect
(
createLabelLink
.
text
()).
not
.
toBe
(
'
Create label
'
);
});
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_vue/store/getters_spec.js
View file @
a223014a
...
...
@@ -26,7 +26,10 @@ describe('LabelsSelect Getters', () => {
});
it
(
'
returns first label title and remaining labels count when state.labels has more than 1 label
'
,
()
=>
{
const
labels
=
[{
id
:
1
,
title
:
'
Foo
'
,
set
:
true
},
{
id
:
2
,
title
:
'
Bar
'
,
set
:
true
}];
const
labels
=
[
{
id
:
1
,
title
:
'
Foo
'
,
set
:
true
},
{
id
:
2
,
title
:
'
Bar
'
,
set
:
true
},
];
expect
(
getters
.
dropdownButtonText
({
labels
},
{
isDropdownVariantSidebar
:
true
})).
toBe
(
'
Foo +1 more
'
,
...
...
spec/frontend/vue_shared/components/split_button_spec.js
View file @
a223014a
...
...
@@ -26,10 +26,7 @@ describe('SplitButton', () => {
};
const
findDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findDropdownItem
=
(
index
=
0
)
=>
findDropdown
()
.
findAll
(
GlDropdownItem
)
.
at
(
index
);
const
findDropdownItem
=
(
index
=
0
)
=>
findDropdown
().
findAll
(
GlDropdownItem
).
at
(
index
);
const
selectItem
=
index
=>
{
findDropdownItem
(
index
).
vm
.
$emit
(
'
click
'
);
...
...
spec/frontend/vue_shared/directives/tooltip_spec.js
View file @
a223014a
...
...
@@ -151,11 +151,7 @@ describe('Tooltip directive', () => {
});
it
(
'
should have tooltip plugin applied to all instances
'
,
()
=>
{
expect
(
$
(
wrapper
.
vm
.
$el
)
.
find
(
'
.js-look-for-tooltip
'
)
.
data
(
'
bs.tooltip
'
),
).
toBeDefined
();
expect
(
$
(
wrapper
.
vm
.
$el
).
find
(
'
.js-look-for-tooltip
'
).
data
(
'
bs.tooltip
'
)).
toBeDefined
();
});
});
});
spec/frontend_integration/ide/helpers/ide_helper.js
View file @
a223014a
...
...
@@ -122,10 +122,7 @@ export const waitForTabToOpen = fileName =>
findByText
(
document
.
querySelector
(
'
.multi-file-edit-pane
'
),
fileName
);
export
const
createFile
=
async
(
path
,
content
)
=>
{
const
parentPath
=
path
.
split
(
'
/
'
)
.
slice
(
0
,
-
1
)
.
join
(
'
/
'
);
const
parentPath
=
path
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
const
parentRow
=
await
findAndTraverseToPath
(
parentPath
);
...
...
spec/frontend_integration/test_helpers/factories/commit_id.js
View file @
a223014a
const
COMMIT_ID_LENGTH
=
40
;
const
DEFAULT_COMMIT_ID
=
Array
(
COMMIT_ID_LENGTH
)
.
fill
(
'
0
'
)
.
join
(
''
);
const
DEFAULT_COMMIT_ID
=
Array
(
COMMIT_ID_LENGTH
).
fill
(
'
0
'
).
join
(
''
);
export
const
createCommitId
=
(
index
=
0
)
=>
`
${
index
}${
DEFAULT_COMMIT_ID
}
`
.
substr
(
0
,
COMMIT_ID_LENGTH
);
...
...
spec/frontend_integration/test_helpers/utils/obj_spec.js
View file @
a223014a
...
...
@@ -3,9 +3,9 @@ import { withKeys, withValues } from './obj';
describe
(
'
frontend_integration/test_helpers/utils/obj
'
,
()
=>
{
describe
(
'
withKeys
'
,
()
=>
{
it
(
'
picks and maps keys
'
,
()
=>
{
expect
(
withKeys
({
a
:
'
123
'
,
b
:
456
,
c
:
'
d
'
},
{
b
:
'
lorem
'
,
c
:
'
ipsum
'
,
z
:
'
zed
'
})).
toEqual
(
{
lorem
:
456
,
ipsum
:
'
d
'
}
,
);
expect
(
withKeys
({
a
:
'
123
'
,
b
:
456
,
c
:
'
d
'
},
{
b
:
'
lorem
'
,
c
:
'
ipsum
'
,
z
:
'
zed
'
})
,
)
.
toEqual
({
lorem
:
456
,
ipsum
:
'
d
'
})
;
});
});
...
...
spec/javascripts/fly_out_nav_browser_spec.js
View file @
a223014a
...
...
@@ -255,8 +255,9 @@ describe('Fly out sidebar navigation', () => {
showSubLevelItems
(
el
);
expect
(
subItems
.
style
.
transform
).
toBe
(
`translate3d(200px,
${
Math
.
floor
(
el
.
getBoundingClientRect
().
top
)
-
getHeaderHeight
()}
px, 0px)`
,
`translate3d(200px,
${
Math
.
floor
(
el
.
getBoundingClientRect
().
top
)
-
getHeaderHeight
()
}
px, 0px)`
,
);
});
...
...
spec/javascripts/lib/utils/browser_spec.js
View file @
a223014a
...
...
@@ -24,7 +24,7 @@ const PIXEL_TOLERANCE = 0.2;
const
urlToImage
=
url
=>
new
Promise
(
resolve
=>
{
const
img
=
new
Image
();
img
.
onload
=
function
()
{
img
.
onload
=
function
()
{
resolve
(
img
);
};
img
.
src
=
url
;
...
...
spec/javascripts/matchers.js
View file @
a223014a
...
...
@@ -32,8 +32,9 @@ export default {
return
{
pass
:
differentPixels
<
20
,
message
:
`
${
differentPixels
}
pixels differ more than
${
threshold
*
100
}
percent between input and output.`
,
message
:
`
${
differentPixels
}
pixels differ more than
${
threshold
*
100
}
percent between input and output.`
,
};
},
};
...
...
spec/javascripts/test_bundle.js
View file @
a223014a
...
...
@@ -40,7 +40,7 @@ Vue.config.warnHandler = (msg, vm, trace) => {
};
let
hasVueErrors
=
false
;
Vue
.
config
.
errorHandler
=
function
(
err
)
{
Vue
.
config
.
errorHandler
=
function
(
err
)
{
hasVueErrors
=
true
;
fail
(
err
);
};
...
...
@@ -118,8 +118,8 @@ testContexts.forEach(context => {
}
catch
(
err
)
{
console
.
log
(
err
);
console
.
error
(
'
[GL SPEC RUNNER ERROR] Unable to load spec:
'
,
path
);
describe
(
'
Test bundle
'
,
function
()
{
it
(
`includes '
${
path
}
'`
,
function
()
{
describe
(
'
Test bundle
'
,
function
()
{
it
(
`includes '
${
path
}
'`
,
function
()
{
expect
(
err
).
toBeNull
();
});
});
...
...
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