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:
Bilal Qamar
2023-05-26 18:52:56 +05:00
committed by GitHub
parent d80b6faaad
commit 2199a24dd7
32 changed files with 6392 additions and 48055 deletions

View File

@@ -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,

View File

@@ -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: () => {

View File

@@ -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', () => {

View File

@@ -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,

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-import-assign */
import React from 'react';
import { shallow } from 'enzyme';

View File

@@ -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([

View File

@@ -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,

View File

@@ -94,7 +94,7 @@ GalleryCard.propTypes = {
duration: PropTypes.number,
status: PropTypes.string,
statusBadgeVariant: PropTypes.string,
transcripts: PropTypes.array,
transcripts: PropTypes.shape([]),
}).isRequired,
};

View File

@@ -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>);
});

View File

@@ -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