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
af3dd043
Commit
af3dd043
authored
May 11, 2018
by
Dennis Tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up component tests
parent
918077a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
27 deletions
+20
-27
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown_spec.js
...er_dropdowns/components/gke_machine_type_dropdown_spec.js
+2
-2
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js
...ster_dropdowns/components/gke_project_id_dropdown_spec.js
+16
-23
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js
...ke_cluster_dropdowns/components/gke_zone_dropdown_spec.js
+2
-2
No files found.
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_machine_type_dropdown_spec.js
View file @
af3dd043
...
...
@@ -84,10 +84,10 @@ describe('GkeMachineTypeDropdown', () => {
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
vm
.
$store
.
commit
(
SET_MACHINE_TYPES
,
gapiMachineTypesResponseMock
.
items
);
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedMachineTypeMock
);
done
();
});
...
...
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js
View file @
af3dd043
...
...
@@ -43,51 +43,44 @@ describe('GkeProjectIdDropdown', () => {
});
it
(
'
returns default toggle text
'
,
done
=>
{
vm
.
$nextTick
(()
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
setItem
(
emptyProjectMock
);
expect
(
vm
.
toggleText
).
toBe
(
LABELS
.
DEFAULT
);
done
();
});
});
});
it
(
'
returns project name if project selected
'
,
done
=>
{
vm
.
$nextTick
(()
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
toggleText
).
toBe
(
selectedProjectMock
.
name
);
done
();
});
});
});
it
(
'
returns empty toggle text
'
,
done
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$store
.
commit
(
SET_PROJECTS
,
[]);
vm
.
setItem
(
emptyProjectMock
);
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
toggleText
).
toBe
(
LABELS
.
EMPTY
);
done
();
});
});
});
});
describe
(
'
selectItem
'
,
()
=>
{
it
(
'
reflects new value when dropdown item is clicked
'
,
done
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
vm
.
$nextTick
(()
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedProjectMock
.
projectId
);
done
();
});
});
});
});
});
});
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js
View file @
af3dd043
...
...
@@ -66,10 +66,10 @@ describe('GkeZoneDropdown', () => {
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
vm
.
$store
.
commit
(
SET_ZONES
,
gapiZonesResponseMock
.
items
);
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedZoneMock
);
done
();
});
...
...
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