Skip to content

Commit

Permalink
adding test to cover sending only namespacetyps
Browse files Browse the repository at this point in the history
  • Loading branch information
WafaaNasr committed Dec 1, 2022
1 parent 5ebe9f2 commit c1bae06
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,44 @@ describe('findRuleExceptionReferencesRoute', () => {
],
});
});

test('returns 200 when passing namespaceTypes', async () => {
const request = requestMock.create({
method: 'get',
path: `${DETECTION_ENGINE_RULES_EXCEPTIONS_REFERENCE_URL}?exception_list`,
query: {
namespace_types: 'single,agnostic',
},
});

const response = await server.inject(request, requestContextMock.convertContext(context));

expect(response.status).toEqual(200);
expect(response.body).toEqual({
references: [
{
my_default_list: {
...mockList,
referenced_rules: [
{
exception_lists: [
{
id: '4656dc92-5832-11ea-8e2d-0242ac130003',
list_id: 'my_default_list',
namespace_type: 'single',
type: 'detection',
},
],
id: '04128c15-0d1b-4716-a4c5-46997ac7f3bd',
name: 'Detect Root/Admin Users',
rule_id: 'rule-1',
},
],
},
},
],
});
});
});

describe('error codes', () => {
Expand Down

0 comments on commit c1bae06

Please sign in to comment.