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
91db0aef
Commit
91db0aef
authored
May 18, 2020
by
Himanshu Kapoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate some filtered_search specs to Jest
parent
de47746a
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
48 deletions
+57
-48
spec/frontend/filtered_search/filtered_search_manager_spec.js
.../frontend/filtered_search/filtered_search_manager_spec.js
+52
-45
spec/frontend/filtered_search/recent_searches_root_spec.js
spec/frontend/filtered_search/recent_searches_root_spec.js
+5
-3
No files found.
spec/
javascripts
/filtered_search/filtered_search_manager_spec.js
→
spec/
frontend
/filtered_search/filtered_search_manager_spec.js
View file @
91db0aef
This diff is collapsed.
Click to expand it.
spec/
javascripts
/filtered_search/recent_searches_root_spec.js
→
spec/
frontend
/filtered_search/recent_searches_root_spec.js
View file @
91db0aef
import
Vue
from
'
vue
'
;
import
RecentSearchesRoot
from
'
~/filtered_search/recent_searches_root
'
;
import
RecentSearchesRoot
from
'
~/filtered_search/recent_searches_root
'
;
jest
.
mock
(
'
vue
'
);
describe
(
'
RecentSearchesRoot
'
,
()
=>
{
describe
(
'
RecentSearchesRoot
'
,
()
=>
{
describe
(
'
render
'
,
()
=>
{
describe
(
'
render
'
,
()
=>
{
let
recentSearchesRoot
;
let
recentSearchesRoot
;
let
data
;
let
data
;
let
template
;
let
template
;
let
VueSpy
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
recentSearchesRoot
=
{
recentSearchesRoot
=
{
...
@@ -14,7 +16,7 @@ describe('RecentSearchesRoot', () => {
...
@@ -14,7 +16,7 @@ describe('RecentSearchesRoot', () => {
},
},
};
};
Vue
Spy
=
spyOnDependency
(
RecentSearchesRoot
,
'
Vue
'
).
and
.
callFake
(
options
=>
{
Vue
.
mockImplementation
(
options
=>
{
({
data
,
template
}
=
options
);
({
data
,
template
}
=
options
);
});
});
...
@@ -22,7 +24,7 @@ describe('RecentSearchesRoot', () => {
...
@@ -22,7 +24,7 @@ describe('RecentSearchesRoot', () => {
});
});
it
(
'
should instantiate Vue
'
,
()
=>
{
it
(
'
should instantiate Vue
'
,
()
=>
{
expect
(
Vue
Spy
).
toHaveBeenCalled
();
expect
(
Vue
).
toHaveBeenCalled
();
expect
(
data
()).
toBe
(
recentSearchesRoot
.
store
.
state
);
expect
(
data
()).
toBe
(
recentSearchesRoot
.
store
.
state
);
expect
(
template
).
toContain
(
'
:is-local-storage-available="isLocalStorageAvailable"
'
);
expect
(
template
).
toContain
(
'
:is-local-storage-available="isLocalStorageAvailable"
'
);
});
});
...
...
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