-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c6cdeb
commit 3eb7483
Showing
75 changed files
with
2,972 additions
and
3,739 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
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 |
---|---|---|
@@ -1,43 +1,41 @@ | ||
import React from 'react'; | ||
import { render, cleanup } from '@testing-library/react'; | ||
import { render, screen } from 'testing'; | ||
import Alert from '.'; | ||
|
||
afterEach(cleanup); | ||
|
||
describe('<Alert />', () => { | ||
it('should render default info type', () => { | ||
const { getByTestId } = render( | ||
render( | ||
<Alert> | ||
<div /> | ||
</Alert> | ||
); | ||
expect(getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-info'); | ||
expect(getByTestId('alert-wrapper').firstChild).toMatchInlineSnapshot(`<div />`); | ||
expect(screen.getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-info'); | ||
expect(screen.getByTestId('alert-wrapper').firstChild).toMatchInlineSnapshot(`<div />`); | ||
}); | ||
it('should render success type', () => { | ||
const { getByTestId } = render( | ||
render( | ||
<Alert type="success"> | ||
<div /> | ||
</Alert> | ||
); | ||
expect(getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-success'); | ||
expect(screen.getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-success'); | ||
}); | ||
|
||
it('should render warning type', () => { | ||
const { getByTestId } = render( | ||
render( | ||
<Alert type="warning"> | ||
<div /> | ||
</Alert> | ||
); | ||
expect(getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-warning'); | ||
expect(screen.getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-warning'); | ||
}); | ||
|
||
it('should render danger type', () => { | ||
const { getByTestId } = render( | ||
render( | ||
<Alert type="danger"> | ||
<div /> | ||
</Alert> | ||
); | ||
expect(getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-danger'); | ||
expect(screen.getByTestId('alert-wrapper')).toHaveClass('alert-component alert-component-danger'); | ||
}); | ||
}); |
Oops, something went wrong.