Resolve Lint errors in NotificationConsoleComponent.ts (#527)

This commit is contained in:
Hardikkumar Nai 2021-04-13 04:36:30 +05:30 committed by GitHub
parent 02e6d8442b
commit 05932e1d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 12 deletions

View File

@ -298,8 +298,6 @@ src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.t
src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx
src/Explorer/Menus/CommandBar/CommandBarUtil.tsx
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.test.tsx
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponent.tsx
src/Explorer/Menus/NotificationConsole/NotificationConsoleComponentAdapter.tsx
src/Explorer/Notebook/NotebookComponent/NotebookComponent.tsx
src/Explorer/Notebook/NotebookComponent/NotebookComponentAdapter.tsx
src/Explorer/Notebook/NotebookComponent/NotebookComponentBootstrapper.tsx

View File

@ -1,9 +1,9 @@
import React from "react";
import { shallow } from "enzyme";
import React from "react";
import {
NotificationConsoleComponentProps,
NotificationConsoleComponent,
ConsoleDataType,
NotificationConsoleComponent,
NotificationConsoleComponentProps,
} from "./NotificationConsoleComponent";
describe("NotificationConsoleComponent", () => {
@ -12,7 +12,7 @@ describe("NotificationConsoleComponent", () => {
consoleData: undefined,
isConsoleExpanded: false,
inProgressConsoleDataIdToBeDeleted: "",
setIsConsoleExpanded: (isExpanded: boolean): void => {},
setIsConsoleExpanded: (): void => undefined,
};
};
@ -98,7 +98,7 @@ describe("NotificationConsoleComponent", () => {
wrapper.setProps(props);
expect(wrapper.find(".notificationConsoleData .date").text()).toEqual(date);
expect(wrapper.find(".notificationConsoleData .message").text()).toEqual(message);
expect(wrapper.exists(`.notificationConsoleData .${iconClassName}`));
expect(wrapper.exists(`.notificationConsoleData .${iconClassName}`)).toBe(true);
};
it("renders progress notifications", () => {
@ -139,7 +139,7 @@ describe("NotificationConsoleComponent", () => {
wrapper.setProps(props);
wrapper.find(".clearNotificationsButton").simulate("click");
expect(!wrapper.exists(".notificationConsoleData"));
expect(wrapper.exists(".notificationConsoleData")).toBe(true);
});
it("collapses and hide content", () => {
@ -155,7 +155,7 @@ describe("NotificationConsoleComponent", () => {
wrapper.setProps(props);
wrapper.find(".notificationConsoleHeader").simulate("click");
expect(!wrapper.exists(".notificationConsoleContent"));
expect(wrapper.exists(".notificationConsoleContent")).toBe(false);
});
it("display latest data in header", () => {

View File

@ -77,7 +77,7 @@ export class NotificationConsoleComponent extends React.Component<
public componentDidUpdate(
prevProps: NotificationConsoleComponentProps,
prevState: NotificationConsoleComponentState
) {
): void {
const currentHeaderStatus = NotificationConsoleComponent.extractHeaderStatus(this.props.consoleData);
if (
@ -98,7 +98,7 @@ export class NotificationConsoleComponent extends React.Component<
}
}
public setElememntRef = (element: HTMLElement) => {
public setElememntRef = (element: HTMLElement): void => {
this.consoleHeaderElement = element;
};
@ -117,7 +117,7 @@ export class NotificationConsoleComponent extends React.Component<
className="notificationConsoleHeader"
id="notificationConsoleHeader"
ref={this.setElememntRef}
onClick={(event: React.MouseEvent<HTMLDivElement>) => this.expandCollapseConsole()}
onClick={() => this.expandCollapseConsole()}
onKeyDown={(event: React.KeyboardEvent<HTMLDivElement>) => this.onExpandCollapseKeyPress(event)}
tabIndex={0}
>