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
9cc3500e
Commit
9cc3500e
authored
Jun 26, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Jun 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix endpoint not being update correctly
parent
398bdce1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
2 deletions
+44
-2
app/assets/javascripts/pipelines/components/stage.vue
app/assets/javascripts/pipelines/components/stage.vue
+1
-2
spec/javascripts/pipelines/stage_spec.js
spec/javascripts/pipelines/stage_spec.js
+43
-0
No files found.
app/assets/javascripts/pipelines/components/stage.vue
View file @
9cc3500e
...
@@ -40,7 +40,6 @@ export default {
...
@@ -40,7 +40,6 @@ export default {
return
{
return
{
isLoading
:
false
,
isLoading
:
false
,
dropdownContent
:
''
,
dropdownContent
:
''
,
endpoint
:
this
.
stage
.
dropdown_path
,
};
};
},
},
...
@@ -73,7 +72,7 @@ export default {
...
@@ -73,7 +72,7 @@ export default {
},
},
fetchJobs
()
{
fetchJobs
()
{
this
.
$http
.
get
(
this
.
endpoint
)
this
.
$http
.
get
(
this
.
stage
.
dropdown_path
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
this
.
dropdownContent
=
response
.
json
().
html
;
this
.
dropdownContent
=
response
.
json
().
html
;
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
...
...
spec/javascripts/pipelines/stage_spec.js
View file @
9cc3500e
...
@@ -83,4 +83,47 @@ describe('Pipelines stage component', () => {
...
@@ -83,4 +83,47 @@ describe('Pipelines stage component', () => {
},
0
);
},
0
);
});
});
});
});
describe
(
'
update endpoint correctly
'
,
()
=>
{
const
updatedInterceptor
=
(
request
,
next
)
=>
{
if
(
request
.
url
===
'
bar
'
)
{
next
(
request
.
respondWith
(
JSON
.
stringify
({
html
:
'
this is the updated content
'
}),
{
status
:
200
,
}));
}
next
();
};
beforeEach
(()
=>
{
Vue
.
http
.
interceptors
.
push
(
updatedInterceptor
);
});
afterEach
(()
=>
{
Vue
.
http
.
interceptors
=
_
.
without
(
Vue
.
http
.
interceptors
,
updatedInterceptor
,
);
});
it
(
'
should update the stage to request the new endpoint provided
'
,
(
done
)
=>
{
component
.
stage
=
{
status
:
{
group
:
'
running
'
,
icon
:
'
running
'
,
title
:
'
running
'
,
},
dropdown_path
:
'
bar
'
,
};
Vue
.
nextTick
(()
=>
{
component
.
$el
.
querySelector
(
'
button
'
).
click
();
setTimeout
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.js-builds-dropdown-container ul
'
).
textContent
.
trim
(),
).
toEqual
(
'
this is the updated content
'
);
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