Commit 2b407b91 authored by Filipa Lacerda's avatar Filipa Lacerda

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

parent 7689c3ec
......@@ -167,7 +167,7 @@ window.Build = (function () {
Build.prototype.getBuildTrace = function () {
return $.ajax({
url: `${this.pageUrl}/trace.json`,
data: this.state,
data: { state: this.state },
})
.done((log) => {
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', () => {
});
});
});
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