-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show warning unknown check selection (#840)
* Remove not_found error handling * Create WarningBanner component * Add jest test to WarningBanner * Include e2e test for the warning banner * Set the unknown provider value to a constant
- Loading branch information
Showing
8 changed files
with
894 additions
and
52 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
import { EOS_WARNING_OUTLINED } from 'eos-icons-react'; | ||
|
||
const WarningBanner = ({ children }) => { | ||
return ( | ||
<div className="bg-yellow-50 rounded mt-2 mb-2 p-3 border-2 border-yellow-500"> | ||
<div className="flex flex-wrap items-center justify-between"> | ||
<div className="flex w-0 flex-1 items-center"> | ||
<EOS_WARNING_OUTLINED className="h-6 w-6 fill-yellow-500" /> | ||
<p className="ml-3 truncate font-medium"> | ||
<span | ||
data-testid="warning-banner" | ||
className="md:inline text-yellow-500" | ||
> | ||
{children} | ||
</span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WarningBanner; |
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,21 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import '@testing-library/jest-dom'; | ||
|
||
import WarningBanner from './WarningBanner'; | ||
|
||
describe('WarningBanner', () => { | ||
it('should display a warning banner with its text and icon', () => { | ||
render( | ||
<WarningBanner> | ||
Warning! | ||
<br /> | ||
You should have a look on this! | ||
</WarningBanner> | ||
); | ||
|
||
expect(screen.getByTestId('warning-banner')).toHaveTextContent( | ||
'Warning!You should have a look on this!' | ||
); | ||
}); | ||
}); |
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
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.