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
33b81a8c
Commit
33b81a8c
authored
Mar 03, 2020
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrated search_spec.js to Jest
parent
90b7f0b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
spec/frontend/search_spec.js
spec/frontend/search_spec.js
+7
-6
No files found.
spec/
javascripts
/search_spec.js
→
spec/
frontend
/search_spec.js
View file @
33b81a8c
...
...
@@ -2,6 +2,8 @@ import $ from 'jquery';
import
Api
from
'
~/api
'
;
import
Search
from
'
~/pages/search/show/search
'
;
jest
.
mock
(
'
~/api
'
);
describe
(
'
Search
'
,
()
=>
{
const
fixturePath
=
'
search/show.html
'
;
const
searchTerm
=
'
some search
'
;
...
...
@@ -19,20 +21,19 @@ describe('Search', () => {
new
Search
();
// eslint-disable-line no-new
});
it
(
'
requests groups from backend when filtering
'
,
done
=>
{
spyOn
(
Api
,
'
groups
'
).
and
.
callFake
(
term
=>
{
it
(
'
requests groups from backend when filtering
'
,
()
=>
{
jest
.
spyOn
(
Api
,
'
groups
'
).
mockImplementation
(
term
=>
{
expect
(
term
).
toBe
(
searchTerm
);
done
();
});
const
inputElement
=
fillDropdownInput
(
'
.js-search-group-dropdown
'
);
$
(
inputElement
).
trigger
(
'
input
'
);
});
it
(
'
requests projects from backend when filtering
'
,
done
=>
{
spyOn
(
Api
,
'
projects
'
).
and
.
callFake
(
term
=>
{
it
(
'
requests projects from backend when filtering
'
,
()
=>
{
jest
.
spyOn
(
Api
,
'
projects
'
).
mockImplementation
(
term
=>
{
expect
(
term
).
toBe
(
searchTerm
);
done
();
});
const
inputElement
=
fillDropdownInput
(
'
.js-search-project-dropdown
'
);
...
...
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