Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Update dependencies #2601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions browser/src/Services/DragAndDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const DropCollect = (connect: DND.DropTargetConnector, monitor: DND.DropTargetMo
/**
* A component which can have items of a specific matching type dropped onto it
*/
@DND.DropTarget<IDroppeable>(({ accepts }) => accepts, DropTarget, DropCollect)
@DND.DropTarget<IDroppeable & any>(({ accepts }) => accepts, DropTarget, DropCollect)
export class Droppeable<P extends IDroppeable> extends React.Component<P> {
public render() {
const { isOver, connectDropTarget, canDrop, didDrop } = this.props
Expand Down Expand Up @@ -84,7 +84,7 @@ const DragCollect = (connect: DND.DragSourceConnector, monitor: DND.DragSourceMo
* @param {React.Component} A component which is dragged onto another
* @returns {React.Component<P>} A react class component
*/
@DND.DragSource<IDraggeable>(props => props.target, DragSource, DragCollect)
@DND.DragSource<IDraggeable & any>(props => props.target, DragSource, DragCollect)
export class Draggeable<P extends IDraggeable> extends React.Component<P> {
public render() {
const { isDragging, connectDragSource } = this.props
Expand All @@ -109,8 +109,8 @@ interface IDragDrop {
/**
* A render prop which takes a given component and makes it a drop target as well as draggeable
*/
@DND.DropTarget<IDragDrop>(props => props.accepts, DropTarget, DropCollect)
@DND.DragSource<IDragDrop>(props => props.dragTarget, DragSource, DragCollect)
@DND.DropTarget<IDragDrop & any>(props => props.accepts, DropTarget, DropCollect)
@DND.DragSource<IDragDrop & any>(props => props.dragTarget, DragSource, DragCollect)
export class DragAndDrop<P extends IDragDrop> extends React.Component<P> {
public render() {
const { connectDragSource, connectDropTarget } = this.props
Expand Down
7 changes: 5 additions & 2 deletions browser/src/Services/Menu/MenuComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class MenuView extends React.PureComponent<IMenuProps, {}> {
*/
private handleHide = (event: any) => {
const node = ReactDOM.findDOMNode(this._popupBody)
if (!node.contains(event.target as Node)) {
if (typeof node !== "string" && !node.contains(event.target as Node)) {
this.props.onHide()
}
}
Expand Down Expand Up @@ -173,7 +173,10 @@ const mapDispatchToProps = {
onHide: ActionCreators.hidePopupMenu,
}

export const ConnectedMenu: any = connect(mapStateToProps, mapDispatchToProps)(MenuView)
export const ConnectedMenu: any = connect(
mapStateToProps,
mapDispatchToProps,
)(MenuView)

export const MenuContainer = () => {
return (
Expand Down
7 changes: 5 additions & 2 deletions browser/src/UI/components/CommandLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface ICommandLineRendererProps {
prompt: string
}

interface State {
export interface ICommandLineRendererState {
focused: boolean
}

Expand All @@ -74,7 +74,10 @@ export const CommandLineIcon = (props: { iconName: string; arrow?: boolean }) =>
</span>
)

export class CommandLine extends React.PureComponent<ICommandLineRendererProps, State> {
export class CommandLine extends React.PureComponent<
ICommandLineRendererProps,
ICommandLineRendererState
> {
public state = {
focused: false,
}
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,8 @@
"oni-ripgrep": "0.0.4",
"oni-types": "^0.0.8",
"react": "^16.3.2",
"react-dnd": "^2.5.4",
"react-dnd-html5-backend": "^2.5.4",
"react-dnd": "^5.0.0",
"react-dnd-html5-backend": "^5.0.1",
"react-dom": "^16.3.2",
"redux-batched-subscribe": "^0.1.6",
"shell-env": "^0.3.0",
Expand Down Expand Up @@ -916,8 +916,7 @@
"@types/msgpack-lite": "0.1.4",
"@types/node": "8.0.53",
"@types/react": "^16.3.16",
"@types/react-dnd": "^2.0.34",
"@types/react-dnd-html5-backend": "^2.1.8",
"@types/react-dnd-html5-backend": "^3.0.2",
"@types/react-dom": "^16.0.5",
"@types/react-motion": "0.0.23",
"@types/react-redux": "5.0.12",
Expand Down Expand Up @@ -1005,7 +1004,7 @@
"webdriverio": "4.8.0",
"webpack": "^4.6.0",
"webpack-bundle-analyzer": "^2.11.1",
"webpack-cli": "^2.0.14",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.3"
},
"collective": {
Expand Down
1 change: 0 additions & 1 deletion ui-tests/BrowserView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
import { Configuration } from "../browser/src/Services/Configuration"

const mockEvent = new Event<void>()
const dispatch = () => mockEvent.dispatch()

const MockWebviewElement = (spy: (args?: any) => void) =>
({
Expand Down
13 changes: 10 additions & 3 deletions ui-tests/CommandLine.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { mount, shallow } from "enzyme"
import { CommonWrapper, mount, shallow } from "enzyme"
import { shallowToJson } from "enzyme-to-json"
import * as React from "react"
import { Provider } from "react-redux"
import configureStore, { MockStore, MockStoreCreator } from "redux-mock-store"
import ConnectCommand, { CommandLine } from "../browser/src/UI/components/CommandLine"
import ConnectCommand, {
CommandLine,
ICommandLineRendererProps,
ICommandLineRendererState,
} from "../browser/src/UI/components/CommandLine"

const mockStore: MockStoreCreator<IState> = configureStore()

Expand Down Expand Up @@ -65,7 +69,10 @@ describe("<Commandline />", () => {
})

it("should initially not have a focused state when rendered", () => {
const wrapper = shallow(CommandLineComponent)
const wrapper: CommonWrapper<
ICommandLineRendererProps,
ICommandLineRendererState
> = shallow(CommandLineComponent)
expect(wrapper.state().focused).toBe(false)
})

Expand Down
1 change: 0 additions & 1 deletion ui-tests/ContextMenuComponent.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount, ReactWrapper } from "enzyme"
import toJson from "enzyme-to-json"
import * as React from "react"

import {
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/ErrorInfo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react"
import { shallow } from "enzyme"
import { Diagnostic } from "vscode-languageserver-types"

import { ErrorInfo, DiagnosticMessage } from "../browser/src/UI/components/ErrorInfo"
import { ErrorInfo } from "../browser/src/UI/components/ErrorInfo"

describe("<ErrorInfo />", () => {
const errors: Diagnostic[] = [
Expand Down
10 changes: 5 additions & 5 deletions ui-tests/ExplorerSplit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ jest.mock("../browser/src/Services/WindowManager/WindowManager")
jest.mock("../browser/src/Services/Explorer/ExplorerView")
jest.mock("../browser/src/Services/Explorer/ExplorerStore")

import * as React from "react"
import { shallow } from "enzyme"
import "react"
import { Store } from "redux"

import MockOni from "./mocks/Oni"

Expand Down Expand Up @@ -47,7 +47,7 @@ describe("ExplorerSplit", () => {
})

it("dispatches SELECT_FILE_SUCCESS if fileToSelect matches selected item", () => {
store.getState.mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
;(store.getState as any).mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
_getSelectedItem.mockReturnValue({
type: "file",
filePath: "/path/to/file.cpp",
Expand All @@ -59,7 +59,7 @@ describe("ExplorerSplit", () => {
})

it("does not dispatch SELECT_FILE_SUCCESS if fileToSelect isn't selected", () => {
store.getState.mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
;(store.getState as any).mockReturnValue({ fileToSelect: "/path/to/file.cpp" })
_getSelectedItem.mockReturnValue({
type: "file",
filePath: "/something/else.cpp",
Expand All @@ -71,7 +71,7 @@ describe("ExplorerSplit", () => {
})

it("does not dispatch SELECT_FILE_SUCCESS if there is no fileToSelect", () => {
store.getState.mockReturnValue({ fileToSelect: null })
;(store.getState as any).mockReturnValue({ fileToSelect: null })

explorerSplit["_onSelectionChanged"]("a")

Expand Down
2 changes: 1 addition & 1 deletion ui-tests/ExternalMenus.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mount, shallow } from "enzyme"
import { shallow } from "enzyme"
import { shallowToJson } from "enzyme-to-json"
import * as React from "react"

Expand Down
5 changes: 1 addition & 4 deletions ui-tests/HighlightText.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { mount, shallow } from "enzyme"
import { shallowToJson } from "enzyme-to-json"
import * as React from "react"

import * as os from "os"

import { HighlightTextByIndex } from "./../browser/src/UI/components/HighlightText"

const highlightComponent = "em"
Expand Down Expand Up @@ -38,7 +35,7 @@ describe("<HighlightTextByIndex />", () => {
it("renders the correct text with no highlights", () => {
const testState = {
highlightComponent,
highlightIndices: [],
highlightIndices: [] as number[],
text: "no highlight text",
className: "test-class",
}
Expand Down
3 changes: 1 addition & 2 deletions ui-tests/NeovimBufferLayersView.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { shallow } from "enzyme"
import { BufferLayer, BufferLayerRenderContext } from "oni-api"
import * as React from "react"

import { IBufferLayer } from "./../browser/src/Editor/NeovimEditor/BufferLayerManager"
Expand Down Expand Up @@ -62,7 +61,7 @@ describe("<NeovimBufferLayersView/>", () => {
expect(wrapper.find("#test-layer").length).toBe(1)
})
it("should call the layers render function with the correct args", () => {
const wrapper = shallow(
shallow(
<NeovimBufferLayersView
fontPixelHeight={10}
fontPixelWidth={3}
Expand Down
2 changes: 0 additions & 2 deletions ui-tests/NodeView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe("<NodeView />", () => {
const Node = (
<NodeView
yanked={[] as string[]}
measure={() => null}
isCreating={false}
isRenaming={testNode}
moveFileOrFolder={() => ({})}
Expand All @@ -40,7 +39,6 @@ describe("<NodeView />", () => {
const wrapper = shallow(
<NodeView
yanked={[] as string[]}
measure={() => null}
isCreating={false}
isRenaming={testNode}
moveFileOrFolder={() => ({})}
Expand Down
3 changes: 1 addition & 2 deletions ui-tests/NotificationView.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { mount, shallow, configure } from "enzyme"
import { shallow } from "enzyme"
import { shallowToJson } from "enzyme-to-json"
import * as React from "react"

import styled from "styled-components"
import {
Button,
NotificationContents,
Expand Down
6 changes: 1 addition & 5 deletions ui-tests/QuickInfo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import * as React from "react"

import * as os from "os"

import {
QuickInfoDocumentation,
QuickInfoTitle,
Title,
} from "./../browser/src/UI/components/QuickInfo"
import { QuickInfoDocumentation, QuickInfoTitle } from "./../browser/src/UI/components/QuickInfo"

describe("<QuickInfo />", () => {
it("renders a shallow instance of the component", () => {
Expand Down
12 changes: 6 additions & 6 deletions ui-tests/SessionManager.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ const mockPersistentStore = {
resolve(this._store || {})
})
},
set(obj: { [key: string]: any }) {
set(obj: { [key: string]: any }): Promise<void> {
return new Promise(resolve => {
this._store = { ...this._store, ...obj }
resolve(null)
resolve()
})
},
delete(key: string) {
delete(key: string): Promise<any> {
delete this._store[key]
return new Promise(resolve => resolve(this._store))
},
has(key) {
has(key: string) {
return !!this._store[key]
},
}
Expand Down Expand Up @@ -68,8 +68,8 @@ describe("Session Manager Tests", () => {

it("should correctly update a session", async () => {
await manager.persistSession("test-session")
await manager.updateOniSession("test-session", { newValue: 2 })
const session = await manager.getSessionFromStore("test-session")
await manager.updateOniSession("test-session", { newValue: 2 } as any)
const session: any = await manager.getSessionFromStore("test-session")
expect(session.newValue).toBe(2)
})
})
6 changes: 3 additions & 3 deletions ui-tests/Sessions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ describe("<Sessions />", () => {
id: "test-1",
file: "/sessions/test.vim",
directory: "/sessions",
updatedAt: null,
updatedAt: null as any,
workspace: "/workspace",
},
{
name: "testing",
id: "testing-2",
file: "/sessions/testing.vim",
directory: "/sessions",
updatedAt: null,
updatedAt: null as any,
workspace: "/workspace",
},
]
it("should render without crashing", () => {
const wrapper = shallow(
shallow(
<Sessions
active
cancelCreating={noop}
Expand Down
6 changes: 1 addition & 5 deletions ui-tests/SidebarStore.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
decreaseWidth,
increaseWidth,
sidebarReducer,
} from "./../browser/src/Services/Sidebar/SidebarStore"
import { decreaseWidth, increaseWidth } from "./../browser/src/Services/Sidebar/SidebarStore"

describe("Change size function", () => {
it("Should correctly return an increased size", () => {
Expand Down
14 changes: 0 additions & 14 deletions ui-tests/Tabs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,6 @@ describe("<Tabs /> Tests", () => {
/>
)

const unfocusedTab = (
<Tabs
fontSize="1.2em"
shouldShowHighlight={false}
mode="normal"
maxWidth="20em"
height="2em"
fontFamily="inherit"
shouldWrap={false}
visible={false}
tabs={[tab1]}
/>
)

afterEach(() => {
tabCloseFunction.mockReset()
tabSelectFunction.mockReset()
Expand Down
16 changes: 8 additions & 8 deletions ui-tests/TokenThemeProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "jest-styled-components"

import TokenThemeProvider from "./../browser/src/Services/SyntaxHighlighting/TokenThemeProvider"
import { TokenColor } from "./../browser/src/Services/TokenColors"
import styled, { css } from "./../browser/src/UI/components/common"
import styled from "./../browser/src/UI/components/common"

const tokenColors: TokenColor[] = [
{
Expand Down Expand Up @@ -55,13 +55,13 @@ describe("<TokenThemeProvider />", () => {
})

test.each`
className | cssRule | result
${".string-quoted"} | ${"color"} | ${"green"}
${".string-quoted"} | ${"font-style"} | ${"italic"}
${".string-quoted"} | ${"font-weight"}| ${"bold"}
${".entity-name-struct"} | ${"color"} | ${"rebeccapurple"}
${".entity-name-struct"} | ${"font-style"} | ${"italic"}
${".entity-name-struct"} | ${"font-weight"}| ${undefined}
className | cssRule | result
${".string-quoted"} | ${"color"} | ${"green"}
${".string-quoted"} | ${"font-style"} | ${"italic"}
${".string-quoted"} | ${"font-weight"} | ${"bold"}
${".entity-name-struct"} | ${"color"} | ${"rebeccapurple"}
${".entity-name-struct"} | ${"font-style"} | ${"italic"}
${".entity-name-struct"} | ${"font-weight"} | ${undefined}
`(
"the TokenThemeProvider returns a nested class rule with a style of $cssRule with a value of $result for $className",
({ cssRule, result, className }) => {
Expand Down
2 changes: 1 addition & 1 deletion ui-tests/VersionControl/VersionControlComponents.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("<Branch />", () => {
const diff = {
insertions: 2,
deletions: 8,
files: null,
files: null as any,
}

it("Should render without crashing", () => {
Expand Down
Loading