-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from launchrctl/tests
Trying to write first test
- Loading branch information
Showing
16 changed files
with
4,951 additions
and
1,661 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-react", | ||
"@babel/preset-typescript" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ node_modules/ | |
.snapshots/ | ||
*.min.js | ||
**/**/coverage | ||
jest.config.ts |
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,16 @@ | ||
import type { Config } from 'jest' | ||
|
||
const config: Config = { | ||
preset: 'ts-jest', | ||
transform: { | ||
'^.+\\.(ts|tsx)?$': 'ts-jest', | ||
}, | ||
testEnvironment: 'jsdom', | ||
moduleNameMapper: { | ||
'\\.(css|less|scss|sass|svg)$': 'identity-obj-proxy', | ||
nanoid: '<rootDir>/node_modules/nanoid/index.browser.cjs', | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
} | ||
|
||
export default config |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,36 @@ | ||
import { Alert, AlertTitle } from '@mui/material' | ||
import { AlertColor } from '@mui/material/Alert/Alert' | ||
import { Box } from '@mui/system' | ||
import { FC } from 'react' | ||
|
||
export const AlertBanner: FC<{ | ||
data: { | ||
title: string | ||
content?: string | ||
type?: AlertColor | ||
} | ||
}> = ({ data }) => { | ||
return ( | ||
<Box | ||
sx={{ | ||
position: 'fixed', | ||
top: (theme) => ({ | ||
xs: theme.spacing(9), | ||
sm: theme.spacing(11), | ||
}), | ||
left: (theme) => ({ | ||
xs: theme.spacing(2), | ||
sm: theme.spacing(3), | ||
}), | ||
zIndex: 'modal', | ||
}} | ||
> | ||
<Alert severity={data.type || 'error'}> | ||
{data.title && <AlertTitle>{data.title}</AlertTitle>} | ||
{data.content && ( | ||
<span dangerouslySetInnerHTML={{ __html: data.content }} /> | ||
)} | ||
</Alert> | ||
</Box> | ||
) | ||
} |
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.