-
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.
Unit tests for public components (#383)
* [FEATURE] Detector must have at least one alert set #288 Signed-off-by: Jovan Cvetkovic <[email protected]> * [BUG] Create detector | Interval field can be empty #378 Signed-off-by: Jovan Cvetkovic <[email protected]> * Adjust styling for Finding details flyout #369 Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * detector unit tests Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * unit tests review Signed-off-by: Jovan Cvetkovic <[email protected]> * Feature/update vertical domain #372 Signed-off-by: Jovan Cvetkovic <[email protected]> * Unit tests for public components #383 Signed-off-by: Jovan Cvetkovic <[email protected]> * Unit tests for public components #383 Signed-off-by: Jovan Cvetkovic <[email protected]> * Unit tests for public components #383 Signed-off-by: Jovan Cvetkovic <[email protected]> * Unit tests for public components #383 Signed-off-by: Jovan Cvetkovic <[email protected]> * Unit tests for public components #383 [BUG] Detector Edit | Custom rule are not selected on update rules #406 Signed-off-by: Jovan Cvetkovic <[email protected]> * Unit tests for public components #383 [BUG] Detector Edit | Custom rule are not selected on update rules #406 Signed-off-by: Jovan Cvetkovic <[email protected]> * PR code review Signed-off-by: Jovan Cvetkovic <[email protected]> * PR code review Signed-off-by: Jovan Cvetkovic <[email protected]> --------- Signed-off-by: Jovan Cvetkovic <[email protected]>
- Loading branch information
1 parent
c19107e
commit 0150c89
Showing
94 changed files
with
29,859 additions
and
111 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
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 |
---|---|---|
|
@@ -17,6 +17,7 @@ describe('<DeleteModal /> spec', () => { | |
type={'some type'} | ||
/> | ||
); | ||
|
||
expect(tree).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
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
16 changes: 16 additions & 0 deletions
16
public/pages/Alerts/components/AlertFlyout/AlertFlyout.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,16 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { AlertFlyout } from './AlertFlyout'; | ||
import alertFlyoutMock from '../../../../../test/mocks/Alerts/components/AlertFlyout/AlertFlyout.mock'; | ||
|
||
describe('<AlertFlyout /> spec', () => { | ||
it('renders the component', () => { | ||
const { container } = render(<AlertFlyout {...alertFlyoutMock} />); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
public/pages/Alerts/components/AlertFlyout/__snapshots__/AlertFlyout.test.tsx.snap
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,8 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<AlertFlyout /> spec renders the component 1`] = ` | ||
<div | ||
aria-hidden="true" | ||
data-aria-hidden="true" | ||
/> | ||
`; |
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,28 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import Alerts from './Alerts'; | ||
import contextMock from '../../../../../test/mocks/useContext.mock'; | ||
import { mount } from 'enzyme'; | ||
import alertsMock from '../../../../../test/mocks/Alerts/Alerts.mock'; | ||
import { shallowToJson } from 'enzyme-to-json'; | ||
import { Router } from 'react-router-dom'; | ||
import browserHistoryMock from '../../../../../test/mocks/services/browserHistory.mock'; | ||
|
||
describe('<Alerts /> spec', () => { | ||
it('renders the component', () => { | ||
Alerts.WrappedComponent.contextType = contextMock; | ||
const wrapper = mount( | ||
<Router history={browserHistoryMock}> | ||
<Alerts {...alertsMock} /> | ||
</Router>, | ||
{ | ||
context: contextMock, | ||
} | ||
); | ||
expect(shallowToJson(wrapper.root().children())).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.