-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove unused service Signed-off-by: Aleksandar Djindjic <[email protected]> * refactor form state Signed-off-by: Aleksandar Djindjic <[email protected]> * extract model and mappers Signed-off-by: Aleksandar Djindjic <[email protected]> * Extract Visual Rule Editor Component Signed-off-by: Aleksandar Djindjic <[email protected]> * fix missing default id Signed-off-by: Aleksandar Djindjic <[email protected]> * yaml editor Signed-off-by: Aleksandar Djindjic <[email protected]> * yaml rule editor mappings Signed-off-by: Aleksandar Djindjic <[email protected]> * more mapping guards Signed-off-by: Aleksandar Djindjic <[email protected]> * remove console.log's Signed-off-by: Aleksandar Djindjic <[email protected]> * YAML editor - cypress test Signed-off-by: Aleksandar Djindjic <[email protected]> * yaml editor snapshot test Signed-off-by: Aleksandar Djindjic <[email protected]> * rename model Signed-off-by: Aleksandar Djindjic <[email protected]> * more validations on yaml editor Signed-off-by: Aleksandar Djindjic <[email protected]> * use eui form validation error box Signed-off-by: Aleksandar Djindjic <[email protected]> * re-generate snapshot Signed-off-by: Aleksandar Djindjic <[email protected]> * 153: rule yaml preview Signed-off-by: Aleksandar Djindjic <[email protected]> * cypress test for rule yaml preview Signed-off-by: Aleksandar Djindjic <[email protected]> * update snapshot test Signed-off-by: Aleksandar Djindjic <[email protected]> * propagate ruleId to rule viewers Signed-off-by: Aleksandar Djindjic <[email protected]> Signed-off-by: Aleksandar Djindjic <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,117 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
public/pages/Rules/components/RuleContentViewer/RuleContentViewer.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { RuleContentViewer } from './RuleContentViewer'; | ||
|
||
describe('<RuleContentViewer /> spec', () => { | ||
it('renders the component', () => { | ||
const { container } = render( | ||
<RuleContentViewer | ||
rule={ | ||
{ | ||
prePackaged: false, | ||
_source: { | ||
category: 'dns', | ||
title: 'My Rule', | ||
log_source: 'dns', | ||
description: 'My Rule', | ||
references: [], | ||
tags: [], | ||
level: 'high', | ||
false_positives: [], | ||
author: 'aleksandar', | ||
status: 'stable', | ||
last_update_time: '2022-11-22T23:00:00.000Z', | ||
queries: [ | ||
{ | ||
value: 'EventID: 4800', | ||
}, | ||
], | ||
rule: | ||
'id: 25b9c01c-350d-4b95-bed1-836d04a4f324\ntitle: My Rule\ndescription: My Rule\nstatus: stable\nauthor: aleksandar\ndate: 2022/11/23\nmodified: 2022/11/23\nlogsource:\n category: dns\nlevel: high\ndetection:\n selection:\n EventID: 4800\n condition: selection\n', | ||
detection: 'selection:\n EventID: 4800\ncondition: selection\n', | ||
}, | ||
} as any | ||
} | ||
></RuleContentViewer> | ||
); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.