-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade dev dependencies and types #3370
Changes from 8 commits
2575cdf
1219a4f
e1a017a
ffd7a76
67dc885
4b7d59b
96f0132
3c5b0b8
a79d12d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"lerna": "2.7.1", | ||
"lerna": "2.11.0", | ||
"npmClient": "yarn", | ||
"useWorkspaces": true, | ||
"version": "independent" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,10 @@ const POPPER_MODIFIERS: PopperModifiers = { | |
}; | ||
const TRANSITION_DURATION = 100; | ||
|
||
type IContextMenuProps = IOverlayLifecycleProps; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 This is definitely clearer. |
||
|
||
/* istanbul ignore next */ | ||
class ContextMenu extends AbstractPureComponent<IOverlayLifecycleProps, IContextMenuState> { | ||
class ContextMenu extends AbstractPureComponent<IContextMenuProps, IContextMenuState> { | ||
public state: IContextMenuState = { | ||
isDarkTheme: false, | ||
isOpen: false, | ||
|
@@ -126,7 +128,10 @@ export function show(menu: JSX.Element, offset: IOffset, onClose?: () => void, i | |
contextMenuElement = document.createElement("div"); | ||
contextMenuElement.classList.add(Classes.CONTEXT_MENU); | ||
document.body.appendChild(contextMenuElement); | ||
contextMenu = ReactDOM.render(<ContextMenu onClosed={remove} />, contextMenuElement) as ContextMenu; | ||
contextMenu = ReactDOM.render<IContextMenuProps>( | ||
<ContextMenu onClosed={remove} />, | ||
contextMenuElement, | ||
) as ContextMenu; | ||
} | ||
|
||
contextMenu.show(menu, offset, onClose, isDarkTheme); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,13 @@ | |
*/ | ||
|
||
import { expect } from "chai"; | ||
import { mount, ReactWrapper, shallow } from "enzyme"; | ||
import { | ||
mount as untypedMount, | ||
MountRendererProps, | ||
ReactWrapper, | ||
shallow as untypedShallow, | ||
ShallowRendererProps, | ||
} from "enzyme"; | ||
import * as React from "react"; | ||
import { spy } from "sinon"; | ||
|
||
|
@@ -24,12 +30,20 @@ import { | |
Position, | ||
} from "../../src/index"; | ||
|
||
/** | ||
* @see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26979#issuecomment-465304376 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack. |
||
*/ | ||
// tslint:disable no-unnecessary-callback-wrapper | ||
const mount = (el: React.ReactElement, options?: MountRendererProps) => untypedMount<NumericInput>(el, options); | ||
const shallow = (el: React.ReactElement, options?: ShallowRendererProps) => untypedShallow<NumericInput>(el, options); | ||
// tslint:enable no-unnecessary-callback-wrapper | ||
|
||
describe("<NumericInput>", () => { | ||
describe("Defaults", () => { | ||
it("renders the buttons on the right by default", () => { | ||
// this ordering is trivial to test with shallow renderer | ||
// (no DOM elements getting in the way) | ||
const component = shallow(<NumericInput />); | ||
const component = untypedShallow(<NumericInput />); | ||
const rightGroup = component.children().last(); | ||
expect(rightGroup.is(ButtonGroup)).to.be.true; | ||
}); | ||
|
@@ -97,7 +111,7 @@ describe("<NumericInput>", () => { | |
it(`always renders the children in a ControlGroup`, () => { | ||
// if the input is put into a control group by itself, it'll have squared border radii | ||
// on the left, which we don't want. | ||
const component = shallow<INumericInputProps>(<NumericInput />); | ||
const component = shallow(<NumericInput />); | ||
expect(component.find(ControlGroup).exists()).to.be.true; | ||
component.setProps({ buttonPosition: null }); | ||
expect(component.find(ControlGroup).exists()).to.be.true; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ describe("<EditableText>", () => { | |
const OLD_VALUE = "alphabet"; | ||
const NEW_VALUE = "hello"; | ||
|
||
const component = mount( | ||
const component = mount<EditableText>( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oof, this is annoying. Hope you get a response to your question in DefinitelyTyped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's unlikely to be resolved and we'll have to keep doing this |
||
<EditableText isEditing={true} onCancel={cancelSpy} onConfirm={confirmSpy} defaultValue={OLD_VALUE} />, | ||
); | ||
component | ||
|
@@ -96,7 +96,7 @@ describe("<EditableText>", () => { | |
const OLD_VALUE = "alphabet"; | ||
const NEW_VALUE = "hello"; | ||
|
||
const component = mount( | ||
const component = mount<EditableText>( | ||
<EditableText isEditing={true} onCancel={cancelSpy} onConfirm={confirmSpy} defaultValue={OLD_VALUE} />, | ||
); | ||
component | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,15 @@ const RESOURCES: IResourceProps[] = [ | |
export const Resources: React.SFC = () => ( | ||
<> | ||
<div className="blueprint-resources"> | ||
{RESOURCES.map(resource => <ResourceCard key={resource.fileName} {...resource} />)} | ||
{RESOURCES.map(resource => ( | ||
<ResourceCard key={resource.fileName} {...resource} /> | ||
))} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file was failing lint in my PR also. I went ahead and fixed it too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah it was fixed on master with #3374 |
||
</div> | ||
<Callout title="Missing fonts?" intent="warning"> | ||
Download Apple's San Francisco font directly from the source:{" "} | ||
<a href="https://developer.apple.com/fonts/" target="_blank" rel="noopener noreferrer">https://developer.apple.com/fonts/</a> | ||
<a href="https://developer.apple.com/fonts/" target="_blank" rel="noopener noreferrer"> | ||
https://developer.apple.com/fonts/ | ||
</a> | ||
</Callout> | ||
</> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, looks like the only break in Mocha 5.x was to drop support for IE9 and IE10, which seems fine. Here are the release notes.