Skip to content

Commit 93cc54d

Browse files
committed
EMT-67: improve testing
1 parent 046e0bc commit 93cc54d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

x-pack/test/api_integration/apis/endpoint/endpoints.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,29 @@ export default function({ getService }: FtrProviderContext) {
116116
});
117117

118118
it('endpoints api should return page based on filters and paging passed.', async () => {
119+
const notIncludedIp = '10.101.149.26';
119120
const { body } = await supertest
120121
.post('/api/endpoint/endpoints')
121122
.set('kbn-xsrf', 'xxx')
122123
.send({
123124
paging_properties: [
124125
{
125-
page_size: 1,
126+
page_size: 10,
126127
},
127128
{
128-
page_index: 1,
129+
page_index: 0,
129130
},
130131
],
131-
filter: 'not host.ip:10.101.149.26',
132+
filter: `not host.ip:${notIncludedIp}`,
132133
})
133134
.expect(200);
134135
expect(body.total).to.eql(2);
135-
expect(body.endpoints.length).to.eql(1);
136-
expect(body.request_page_size).to.eql(1);
137-
expect(body.request_page_index).to.eql(1);
136+
const availableIps = [].concat(...body.endpoints.map(metadata => metadata.host.ip));
137+
expect(availableIps).to.eql(['10.192.213.130', '10.70.28.129', '10.46.229.234']);
138+
expect(availableIps).not.include.eql(notIncludedIp);
139+
expect(body.endpoints.length).to.eql(2);
140+
expect(body.request_page_size).to.eql(10);
141+
expect(body.request_page_index).to.eql(0);
138142
});
139143
});
140144
});

0 commit comments

Comments
 (0)