Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jillguyonnet committed Aug 26, 2024
1 parent 3d48b91 commit 772e415
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe('requestDiagnostics', () => {

describe('requestDiagnostics (singular)', () => {
it('can request diagnostics for single agent', async () => {
const { esClient, agentInRegularDoc } = createClientMock();
await requestDiagnostics(esClient, agentInRegularDoc._id);
const { soClient, esClient, agentInRegularDoc } = createClientMock();
await requestDiagnostics(esClient, soClient, agentInRegularDoc._id);

expect(esClient.create).toHaveBeenCalledWith(
expect.objectContaining({
Expand Down
32 changes: 16 additions & 16 deletions x-pack/test/fleet_api_integration/apis/space_awareness/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ export default function (providerContext: FtrProviderContext) {
}

it('should only update tags of agents in the same space when passing a list of agent ids', async () => {
verifyAgentsTags({
await verifyAgentsTags({
[defaultSpaceAgent1]: ['tag1'],
[defaultSpaceAgent2]: ['tag1'],
});
verifyAgentsTags(
await verifyAgentsTags(
{
[testSpaceAgent1]: ['tag1'],
[testSpaceAgent2]: ['tag1'],
Expand All @@ -238,11 +238,11 @@ export default function (providerContext: FtrProviderContext) {
TEST_SPACE_1
);

verifyAgentsTags({
await verifyAgentsTags({
[defaultSpaceAgent1]: ['tag1'],
[defaultSpaceAgent2]: ['tag1'],
});
verifyAgentsTags(
await verifyAgentsTags(
{
[testSpaceAgent1]: ['tag1', 'space1'],
[testSpaceAgent2]: ['tag1'],
Expand All @@ -263,11 +263,11 @@ export default function (providerContext: FtrProviderContext) {
TEST_SPACE_1
);

verifyAgentsTags({
await verifyAgentsTags({
[defaultSpaceAgent1]: ['tag1'],
[defaultSpaceAgent2]: ['tag1'],
});
verifyAgentsTags(
await verifyAgentsTags(
{
[testSpaceAgent1]: ['tag1'],
[testSpaceAgent2]: ['tag1'],
Expand All @@ -286,11 +286,11 @@ export default function (providerContext: FtrProviderContext) {
});

it('should only update tags of agents in the same space when passing a kuery', async () => {
verifyAgentsTags({
await verifyAgentsTags({
[defaultSpaceAgent1]: ['tag1'],
[defaultSpaceAgent2]: ['tag1'],
});
verifyAgentsTags(
await verifyAgentsTags(
{
[testSpaceAgent1]: ['tag1'],
[testSpaceAgent2]: ['tag1'],
Expand All @@ -310,11 +310,11 @@ export default function (providerContext: FtrProviderContext) {
TEST_SPACE_1
);

verifyAgentsTags({
await verifyAgentsTags({
[defaultSpaceAgent1]: ['tag1'],
[defaultSpaceAgent2]: ['tag1'],
});
verifyAgentsTags(
await verifyAgentsTags(
{
[testSpaceAgent1]: ['tag1', 'space1'],
[testSpaceAgent2]: ['tag1', 'space1'],
Expand All @@ -335,11 +335,11 @@ export default function (providerContext: FtrProviderContext) {
TEST_SPACE_1
);

verifyAgentsTags({
await verifyAgentsTags({
[defaultSpaceAgent1]: ['tag1'],
[defaultSpaceAgent2]: ['tag1'],
});
verifyAgentsTags(
await verifyAgentsTags(
{
[testSpaceAgent1]: ['tag1'],
[testSpaceAgent2]: ['tag1'],
Expand Down Expand Up @@ -635,11 +635,11 @@ export default function (providerContext: FtrProviderContext) {
expect(agentPolicyIds).to.eql(expected);
}

verifyAgentsPolicies({
await verifyAgentsPolicies({
[defaultSpaceAgent1]: defaultSpacePolicy1.item.id,
[defaultSpaceAgent2]: defaultSpacePolicy2.item.id,
});
verifyAgentsPolicies(
await verifyAgentsPolicies(
{
[testSpaceAgent1]: spaceTest1Policy1.item.id,
[testSpaceAgent2]: spaceTest1Policy2.item.id,
Expand All @@ -659,11 +659,11 @@ export default function (providerContext: FtrProviderContext) {
TEST_SPACE_1
);

verifyAgentsPolicies({
await verifyAgentsPolicies({
[defaultSpaceAgent1]: defaultSpacePolicy1.item.id,
[defaultSpaceAgent2]: defaultSpacePolicy2.item.id,
});
verifyAgentsPolicies(
await verifyAgentsPolicies(
{
[testSpaceAgent1]: spaceTest1Policy2.item.id,
[testSpaceAgent2]: spaceTest1Policy2.item.id,
Expand Down

0 comments on commit 772e415

Please sign in to comment.