mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
test: update test files
This commit is contained in:
@@ -98,7 +98,7 @@ export class ClientSpec {
|
||||
}
|
||||
|
||||
@test
|
||||
async constructWithVersion() {
|
||||
async constructWithHeaders() {
|
||||
sandbox.on(httpClient, 'request', invokeIndexRoute);
|
||||
|
||||
expect(httpClient.request).not.to.have.been.first.called();
|
||||
@@ -109,6 +109,7 @@ export class ClientSpec {
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {},
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-StApps-Version': 'foo.foo.foo',
|
||||
},
|
||||
method: indexRoute.method,
|
||||
@@ -156,7 +157,9 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: feedback,
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: feedbackRoute.method,
|
||||
url: new URL('http://localhost' + feedbackRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -214,7 +217,9 @@ export class ClientSpec {
|
||||
},
|
||||
size: 1,
|
||||
},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: searchRoute.method,
|
||||
url: new URL('http://localhost' + searchRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -302,7 +307,9 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: indexRoute.method,
|
||||
url: new URL('http://localhost' + indexRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -330,7 +337,9 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: undefined,
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: indexRoute.method,
|
||||
url: new URL('http://localhost' + indexRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -389,7 +398,9 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {a: {size: 1}, b: {size: 1}},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: multiSearchRoute.method,
|
||||
url: new URL('http://localhost' + multiSearchRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -437,13 +448,17 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {foo: {size: 0}, bar: {size: 0}},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: multiSearchRoute.method,
|
||||
url: new URL('http://localhost' + multiSearchRoute.getUrlFragment()),
|
||||
});
|
||||
expect(httpClient.request).to.have.been.second.called.with({
|
||||
body: {foo: {size: 1000}, bar: {size: 500}, foobar: {size: 30}},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: multiSearchRoute.method,
|
||||
url: new URL('http://localhost' + multiSearchRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -504,7 +519,9 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {size: 1},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: searchRoute.method,
|
||||
url: new URL('http://localhost' + searchRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -540,7 +557,9 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {from: 30, size: 30},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: searchRoute.method,
|
||||
url: new URL('http://localhost' + searchRoute.getUrlFragment()),
|
||||
});
|
||||
@@ -574,13 +593,17 @@ export class ClientSpec {
|
||||
|
||||
expect(httpClient.request).to.have.been.first.called.with({
|
||||
body: {size: 0},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: searchRoute.method,
|
||||
url: new URL('http://localhost' + searchRoute.getUrlFragment()),
|
||||
});
|
||||
expect(httpClient.request).to.have.been.second.called.with({
|
||||
body: {size: 1000},
|
||||
headers: {},
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
method: searchRoute.method,
|
||||
url: new URL('http://localhost' + searchRoute.getUrlFragment()),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user