mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Joi now converts input to matching option from .valid()
This commit is contained in:
parent
a2ec603ffb
commit
75531b1d09
1 changed files with 11 additions and 6 deletions
|
@ -17,6 +17,8 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import Url from 'url';
|
||||
|
||||
import sinon from 'sinon';
|
||||
import * as requestModule from '../../request';
|
||||
import expect from '@kbn/expect';
|
||||
|
@ -44,12 +46,15 @@ describe('Console Proxy Route', () => {
|
|||
|
||||
teardowns.push(() => server.stop());
|
||||
|
||||
const params = [];
|
||||
if (path != null) params.push(`path=${path}`);
|
||||
if (method != null) params.push(`method=${method}`);
|
||||
return await server.inject({
|
||||
method: 'POST',
|
||||
url: `/api/console/proxy${params.length ? `?${params.join('&')}` : ''}`,
|
||||
url: Url.format({
|
||||
pathname: '/api/console/proxy',
|
||||
query: {
|
||||
path: path == null ? undefined : path,
|
||||
method: method == null ? undefined : method,
|
||||
}
|
||||
}),
|
||||
});
|
||||
};
|
||||
});
|
||||
|
@ -125,11 +130,11 @@ describe('Console Proxy Route', () => {
|
|||
});
|
||||
});
|
||||
describe('is mixed case', () => {
|
||||
it('sends a request with the exact method', async () => {
|
||||
it('sends a request with the method properly cased', async () => {
|
||||
const { statusCode } = await request('HeAd', '/');
|
||||
expect(statusCode).to.be(200);
|
||||
sinon.assert.calledOnce(requestModule.sendRequest);
|
||||
expect(requestModule.sendRequest.getCall(0).args[0].method).to.be('HeAd');
|
||||
expect(requestModule.sendRequest.getCall(0).args[0].method).to.be('HEAD');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue