feat: upgraded to node v18, added .nvmrc and updated workflows (#281)
Co-authored-by: Abdullah Waheed <abdullah.waheed@arbisoft.com>
This commit is contained in:
@@ -45,6 +45,7 @@ export const CodeEditor = ({
|
||||
CodeEditor.propTypes = {
|
||||
innerRef: PropTypes.oneOfType([
|
||||
PropTypes.func,
|
||||
// eslint-disable-next-line react/forbid-prop-types
|
||||
PropTypes.shape({ current: PropTypes.any }),
|
||||
]).isRequired,
|
||||
value: PropTypes.string.isRequired,
|
||||
|
||||
@@ -13,10 +13,12 @@ export const hooks = {
|
||||
},
|
||||
dismissalHooks: ({ dismissError, isError }) => {
|
||||
const [isDismissed, setIsDismissed] = hooks.state.isDismissed(false);
|
||||
React.useEffect(() => {
|
||||
setIsDismissed(isDismissed && !isError);
|
||||
},
|
||||
[isError]);
|
||||
React.useEffect(
|
||||
() => {
|
||||
setIsDismissed(isDismissed && !isError);
|
||||
},
|
||||
[isError],
|
||||
);
|
||||
return {
|
||||
isDismissed,
|
||||
dismissAlert: () => {
|
||||
|
||||
@@ -11,7 +11,9 @@ jest.mock('@edx/frontend-platform/logging', () => ({
|
||||
}));
|
||||
|
||||
// stubbing this to avoid needing to inject a stubbed intl into an internal component
|
||||
jest.mock('./ErrorPage', () => () => <p>Error Page</p>);
|
||||
jest.mock('./ErrorPage', () => function () {
|
||||
return <p>Error Page</p>;
|
||||
});
|
||||
|
||||
describe('ErrorBoundary', () => {
|
||||
it('should render children if no error', () => {
|
||||
|
||||
@@ -129,6 +129,7 @@ ImageUploadModal.propTypes = {
|
||||
close: PropTypes.func.isRequired,
|
||||
editorRef: PropTypes.oneOfType([
|
||||
PropTypes.func,
|
||||
// eslint-disable-next-line react/forbid-prop-types
|
||||
PropTypes.shape({ current: PropTypes.any }),
|
||||
]),
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-import-assign */
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ RawEditor.defaultProps = {
|
||||
RawEditor.propTypes = {
|
||||
editorRef: PropTypes.oneOfType([
|
||||
PropTypes.func,
|
||||
// eslint-disable-next-line react/forbid-prop-types
|
||||
PropTypes.shape({ current: PropTypes.any }),
|
||||
]),
|
||||
content: PropTypes.oneOfType([
|
||||
|
||||
@@ -90,7 +90,7 @@ Gallery.propTypes = {
|
||||
isLoaded: PropTypes.bool.isRequired,
|
||||
galleryIsEmpty: PropTypes.bool.isRequired,
|
||||
searchIsEmpty: PropTypes.bool.isRequired,
|
||||
displayList: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
displayList: PropTypes.arrayOf(PropTypes.shape({})).isRequired,
|
||||
highlighted: PropTypes.string,
|
||||
onHighlightChange: PropTypes.func.isRequired,
|
||||
emptyGalleryLabel: PropTypes.shape({}).isRequired,
|
||||
|
||||
@@ -94,7 +94,7 @@ GalleryCard.propTypes = {
|
||||
duration: PropTypes.number,
|
||||
status: PropTypes.string,
|
||||
statusBadgeVariant: PropTypes.string,
|
||||
transcripts: PropTypes.array,
|
||||
transcripts: PropTypes.shape([]),
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
|
||||
@@ -79,20 +79,22 @@ const mockUploadErrorAlertFn = jest.fn();
|
||||
|
||||
jest.mock('../BaseModal', () => 'BaseModal');
|
||||
jest.mock('./SearchSort', () => 'SearchSort');
|
||||
jest.mock('./Gallery', () => (componentProps) => {
|
||||
jest.mock('./Gallery', () => function (componentProps) {
|
||||
mockGalleryFn(componentProps);
|
||||
return (<div>Gallery</div>);
|
||||
});
|
||||
jest.mock('../FileInput', () => (componentProps) => {
|
||||
jest.mock('../FileInput', () => function (componentProps) {
|
||||
mockFileInputFn(componentProps);
|
||||
return (<div>FileInput</div>);
|
||||
});
|
||||
jest.mock('../ErrorAlerts/ErrorAlert', () => () => (<div>ErrorAlert</div>));
|
||||
jest.mock('../ErrorAlerts/FetchErrorAlert', () => (componentProps) => {
|
||||
jest.mock('../ErrorAlerts/ErrorAlert', () => function () {
|
||||
return <div>ErrorAlert</div>;
|
||||
});
|
||||
jest.mock('../ErrorAlerts/FetchErrorAlert', () => function (componentProps) {
|
||||
mockFetchErrorAlertFn(componentProps);
|
||||
return (<div>FetchErrorAlert</div>);
|
||||
});
|
||||
jest.mock('../ErrorAlerts/UploadErrorAlert', () => (componentProps) => {
|
||||
jest.mock('../ErrorAlerts/UploadErrorAlert', () => function (componentProps) {
|
||||
mockUploadErrorAlertFn(componentProps);
|
||||
return (<div>UploadErrorAlert</div>);
|
||||
});
|
||||
|
||||
@@ -50,6 +50,7 @@ SourceCodeModal.propTypes = {
|
||||
close: PropTypes.func.isRequired,
|
||||
editorRef: PropTypes.oneOfType([
|
||||
PropTypes.func,
|
||||
// eslint-disable-next-line react/forbid-prop-types
|
||||
PropTypes.shape({ current: PropTypes.any }),
|
||||
]).isRequired,
|
||||
// injected
|
||||
|
||||
Reference in New Issue
Block a user