Commit 5e850d5b authored by Phil Hughes's avatar Phil Hughes

Merge branch '38528-build-url' into 'master'

Fixes data parameter not being sent in ajax request for jobs log

Closes #38528

See merge request gitlab-org/gitlab-ce!14564
parents 7639e4ab 2b407b91
...@@ -167,7 +167,7 @@ window.Build = (function () { ...@@ -167,7 +167,7 @@ window.Build = (function () {
Build.prototype.getBuildTrace = function () { Build.prototype.getBuildTrace = function () {
return $.ajax({ return $.ajax({
url: `${this.pageUrl}/trace.json`, url: `${this.pageUrl}/trace.json`,
data: this.state, data: { state: this.state },
}) })
.done((log) => { .done((log) => {
setCiStatusFavicon(`${this.pageUrl}/status.json`); setCiStatusFavicon(`${this.pageUrl}/status.json`);
......
---
title: Fixes data parameter not being sent in ajax request for jobs log
merge_request:
author:
type: fixed
...@@ -289,4 +289,18 @@ describe('Build', () => { ...@@ -289,4 +289,18 @@ describe('Build', () => {
}); });
}); });
}); });
describe('getBuildTrace', () => {
it('should request build trace with state parameter', (done) => {
spyOn(jQuery, 'ajax').and.callThrough();
new Build();
setTimeout(() => {
expect(jQuery.ajax).toHaveBeenCalledWith(
{ url: `${BUILD_URL}/trace.json`, data: { state: '' } },
);
done();
}, 0);
});
});
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment