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
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
Hide 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', () => {
...
@@ -84,10 +84,10 @@ describe('GkeMachineTypeDropdown', () => {
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
vm
.
$store
.
commit
(
SET_MACHINE_TYPES
,
gapiMachineTypesResponseMock
.
items
);
vm
.
$store
.
commit
(
SET_MACHINE_TYPES
,
gapiMachineTypesResponseMock
.
items
);
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedMachineTypeMock
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedMachineTypeMock
);
done
();
done
();
});
});
...
...
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown_spec.js
View file @
af3dd043
...
@@ -43,34 +43,28 @@ describe('GkeProjectIdDropdown', () => {
...
@@ -43,34 +43,28 @@ describe('GkeProjectIdDropdown', () => {
});
});
it
(
'
returns default toggle text
'
,
done
=>
{
it
(
'
returns default toggle text
'
,
done
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$nextTick
(()
=>
{
vm
.
setItem
(
emptyProjectMock
);
vm
.
setItem
(
emptyProjectMock
);
expect
(
vm
.
toggleText
).
toBe
(
LABELS
.
DEFAULT
);
expect
(
vm
.
toggleText
).
toBe
(
LABELS
.
DEFAULT
);
done
();
done
();
});
});
});
});
});
it
(
'
returns project name if project selected
'
,
done
=>
{
it
(
'
returns project name if project selected
'
,
done
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
toggleText
).
toBe
(
selectedProjectMock
.
name
);
expect
(
vm
.
toggleText
).
toBe
(
selectedProjectMock
.
name
);
done
();
done
();
});
});
});
});
});
it
(
'
returns empty toggle text
'
,
done
=>
{
it
(
'
returns empty toggle text
'
,
done
=>
{
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$store
.
commit
(
SET_PROJECTS
,
[]);
vm
.
$store
.
commit
(
SET_PROJECTS
,
[]);
vm
.
setItem
(
emptyProjectMock
);
vm
.
setItem
(
emptyProjectMock
);
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
toggleText
).
toBe
(
LABELS
.
EMPTY
);
expect
(
vm
.
toggleText
).
toBe
(
LABELS
.
EMPTY
);
done
();
done
();
});
});
});
});
});
});
});
...
@@ -79,13 +73,12 @@ describe('GkeProjectIdDropdown', () => {
...
@@ -79,13 +73,12 @@ describe('GkeProjectIdDropdown', () => {
it
(
'
reflects new value when dropdown item is clicked
'
,
done
=>
{
it
(
'
reflects new value when dropdown item is clicked
'
,
done
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$nextTick
(()
=>
{
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedProjectMock
.
projectId
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedProjectMock
.
projectId
);
done
();
done
();
});
});
});
});
});
});
});
...
...
spec/javascripts/projects/gke_cluster_dropdowns/components/gke_zone_dropdown_spec.js
View file @
af3dd043
...
@@ -66,10 +66,10 @@ describe('GkeZoneDropdown', () => {
...
@@ -66,10 +66,10 @@ describe('GkeZoneDropdown', () => {
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
''
);
vm
.
$store
.
commit
(
SET_ZONES
,
gapiZonesResponseMock
.
items
);
vm
.
$store
.
commit
(
SET_ZONES
,
gapiZonesResponseMock
.
items
);
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$el
.
querySelector
(
'
.dropdown-content button
'
).
click
();
vm
.
$nextTick
(()
=>
{
return
vm
.
$nextTick
().
then
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedZoneMock
);
expect
(
vm
.
$el
.
querySelector
(
'
input
'
).
value
).
toBe
(
selectedZoneMock
);
done
();
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