mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Fail tests when context propTypes validation fails (#5323)
* Fail test when context proptypes validation fails * Remove isRequired from context propTypes validation GitOrigin-RevId: c6da5f93672434c0d80be3f659c1fc15dc3dab1f
This commit is contained in:
@@ -37,7 +37,7 @@ export default function FileViewHeader({ file, storeReferencesKeys }) {
|
|||||||
_id: PropTypes.string.isRequired,
|
_id: PropTypes.string.isRequired,
|
||||||
})
|
})
|
||||||
const { permissionsLevel } = useEditorContext({
|
const { permissionsLevel } = useEditorContext({
|
||||||
permissionsLevel: PropTypes.string.isRequired,
|
permissionsLevel: PropTypes.string,
|
||||||
})
|
})
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ before(function () {
|
|||||||
originalConsoleError(message, ...args)
|
originalConsoleError(message, ...args)
|
||||||
|
|
||||||
// Check if the error is from prop-types
|
// Check if the error is from prop-types
|
||||||
if (/Failed prop type/.test(message)) {
|
if (/Failed (prop|data) type/.test(message)) {
|
||||||
// Throw an error, causing the test to fail
|
// Throw an error, causing the test to fail
|
||||||
throw new Error(message)
|
throw new Error(message)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user