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
1b204f07
Commit
1b204f07
authored
Jul 10, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update translations and add basic specs
Add `wrapper = null` to properly clean up after each spec
parent
577b6f4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/issuables_list/components/issuables_list_app_spec.js
...tend/issuables_list/components/issuables_list_app_spec.js
+54
-0
No files found.
locale/gitlab.pot
View file @
1b204f07
...
...
@@ -20124,6 +20124,9 @@ msgstr ""
msgid "Search Button"
msgstr ""
msgid "Search Jira issues"
msgstr ""
msgid "Search Milestones"
msgstr ""
...
...
spec/frontend/issuables_list/components/issuables_list_app_spec.js
View file @
1b204f07
...
...
@@ -7,6 +7,7 @@ import { TEST_HOST } from 'helpers/test_constants';
import
flash
from
'
~/flash
'
;
import
IssuablesListApp
from
'
~/issuables_list/components/issuables_list_app.vue
'
;
import
Issuable
from
'
~/issuables_list/components/issuable.vue
'
;
import
FilteredSearchBar
from
'
~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue
'
;
import
issueablesEventBus
from
'
~/issuables_list/eventhub
'
;
import
{
PAGE_SIZE
,
PAGE_SIZE_MANUAL
,
RELATIVE_POSITION
}
from
'
~/issuables_list/constants
'
;
...
...
@@ -59,6 +60,7 @@ describe('Issuables list component', () => {
const
findLoading
=
()
=>
wrapper
.
find
(
GlSkeletonLoading
);
const
findIssuables
=
()
=>
wrapper
.
findAll
(
Issuable
);
const
findFilteredSearchBar
=
()
=>
wrapper
.
find
(
FilteredSearchBar
);
const
findFirstIssuable
=
()
=>
findIssuables
().
wrappers
[
0
];
const
findEmptyState
=
()
=>
wrapper
.
find
(
GlEmptyState
);
...
...
@@ -75,6 +77,7 @@ describe('Issuables list component', () => {
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
mockAxios
.
restore
();
window
.
location
=
oldLocation
;
});
...
...
@@ -131,6 +134,7 @@ describe('Issuables list component', () => {
});
it
(
'
does not call API until mounted
'
,
()
=>
{
factory
();
expect
(
apiSpy
).
not
.
toHaveBeenCalled
();
});
...
...
@@ -173,6 +177,12 @@ describe('Issuables list component', () => {
expect
(
wrapper
.
find
(
GlPagination
).
exists
()).
toBe
(
true
);
});
});
it
(
'
does not render FilteredSearchBar
'
,
()
=>
{
factory
();
expect
(
findFilteredSearchBar
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
with bulk editing enabled
'
,
()
=>
{
...
...
@@ -523,4 +533,48 @@ describe('Issuables list component', () => {
});
});
});
describe
(
'
when type is "jira"
'
,
()
=>
{
it
(
'
renders FilteredSearchBar
'
,
()
=>
{
factory
({
type
:
'
jira
'
});
expect
(
findFilteredSearchBar
().
exists
()).
toBe
(
true
);
});
describe
(
'
initialSortBy
'
,
()
=>
{
const
query
=
'
?sort=updated_asc
'
;
it
(
'
sets default value
'
,
()
=>
{
factory
({
type
:
'
jira
'
});
expect
(
findFilteredSearchBar
().
props
(
'
initialSortBy
'
)).
toBe
(
'
created_desc
'
);
});
it
(
'
sets value according to query
'
,
()
=>
{
setUrl
(
query
);
factory
({
type
:
'
jira
'
});
expect
(
findFilteredSearchBar
().
props
(
'
initialSortBy
'
)).
toBe
(
'
updated_asc
'
);
});
});
describe
(
'
initialFilterValue
'
,
()
=>
{
it
(
'
does not set value when no query
'
,
()
=>
{
factory
({
type
:
'
jira
'
});
expect
(
findFilteredSearchBar
().
props
(
'
initialFilterValue
'
)).
toEqual
([]);
});
it
(
'
sets value according to query
'
,
()
=>
{
const
query
=
'
?search=free+text
'
;
setUrl
(
query
);
factory
({
type
:
'
jira
'
});
expect
(
findFilteredSearchBar
().
props
(
'
initialFilterValue
'
)).
toEqual
([
'
free text
'
]);
});
});
});
});
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