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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
b4ffaf9e
Commit
b4ffaf9e
authored
Sep 04, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Projects Dropdown App Store Spec
parent
3fcc7460
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
spec/javascripts/projects_dropdown/store/projects_store_spec.js
...avascripts/projects_dropdown/store/projects_store_spec.js
+41
-0
No files found.
spec/javascripts/projects_dropdown/store/projects_store_spec.js
0 → 100644
View file @
b4ffaf9e
import
ProjectsStore
from
'
~/projects_dropdown/store/projects_store
'
;
import
{
mockProject
,
mockRawProject
}
from
'
../mock_data
'
;
describe
(
'
ProjectsStore
'
,
()
=>
{
let
store
;
beforeEach
(()
=>
{
store
=
new
ProjectsStore
();
});
describe
(
'
setFrequentProjects
'
,
()
=>
{
it
(
'
should set frequent projects list to state
'
,
()
=>
{
store
.
setFrequentProjects
([
mockProject
]);
expect
(
store
.
getFrequentProjects
().
length
).
toBe
(
1
);
expect
(
store
.
getFrequentProjects
()[
0
].
id
).
toBe
(
mockProject
.
id
);
});
});
describe
(
'
setSearchedProjects
'
,
()
=>
{
it
(
'
should set searched projects list to state
'
,
()
=>
{
store
.
setSearchedProjects
([
mockRawProject
]);
const
processedProjects
=
store
.
getSearchedProjects
();
expect
(
processedProjects
.
length
).
toBe
(
1
);
expect
(
processedProjects
[
0
].
id
).
toBe
(
mockRawProject
.
id
);
expect
(
processedProjects
[
0
].
namespace
).
toBe
(
mockRawProject
.
name_with_namespace
);
expect
(
processedProjects
[
0
].
webUrl
).
toBe
(
mockRawProject
.
web_url
);
expect
(
processedProjects
[
0
].
avatarUrl
).
toBe
(
mockRawProject
.
avatar_url
);
});
});
describe
(
'
clearSearchedProjects
'
,
()
=>
{
it
(
'
should clear searched projects list from state
'
,
()
=>
{
store
.
setSearchedProjects
([
mockRawProject
]);
expect
(
store
.
getSearchedProjects
().
length
).
toBe
(
1
);
store
.
clearSearchedProjects
();
expect
(
store
.
getSearchedProjects
().
length
).
toBe
(
0
);
});
});
});
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