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

chore(deps): Bump deps, fix tests to match #1152

Merged
merged 1 commit into from
Jun 19, 2020
Merged
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
},
};
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"react-dom": "^16.8.0"
},
"devDependencies": {
"@babel/preset-env": "^7.8.7",
"@babel/preset-env": "^7.10.2",
"@sheerun/mutationobserver-shim": "^0.3.3",
"@storybook/addon-actions": "5.3.19",
"@storybook/addon-docs": "5.3.19",
Expand All @@ -120,28 +120,28 @@
"@storybook/react": "5.3.19",
"@testing-library/jest-dom": "^5.0.2",
"@testing-library/react": "^10.0.1",
"@testing-library/user-event": "^11.0.0",
"@testing-library/user-event": "^12.0.2",
"@types/jest": "^26.0.0",
"@types/react": "^16.9.23",
"@types/react-dom": "^16.9.5",
"@typescript-eslint/eslint-plugin": "^2.23.0",
"@typescript-eslint/parser": "^2.23.0",
"@typescript-eslint/eslint-plugin": "^3.3.0",
"@typescript-eslint/parser": "^3.3.0",
"awesome-typescript-loader": "^5.2.1",
"babel-loader": "^8.0.6",
"bundlesize": "^0.18.0",
"chromatic": "^4.0.2",
"cross-env": "^7.0.2",
"css-loader": "^3.2.0",
"cssnano": "^4.1.10",
"eslint": "^6.5.1",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^4.0.0",
"eslint-plugin-testing-library": "^3.0.0",
"husky": "^4.2.1",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.1.0",
"jest": "^26.0.1",
"jest-junit": "^10.0.0",
"lint-staged": "^10.0.8",
"prettier": "^2.0.0",
Expand All @@ -152,7 +152,7 @@
"sass": "^1.26.3",
"sass-loader": "^8.0.0",
"style-loader": "^1.1.2",
"ts-jest": "^25.0.0",
"ts-jest": "^26.1.0",
"ts-loader": "^7.0.0",
"tsdx": "0.13.2",
"typescript": "^3.8.3"
Expand Down
2 changes: 1 addition & 1 deletion src/CalendarContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface CalendarContainerProps {
isStatic: boolean;
id?: string;
className?: string;
style?: object;
style?: { [x: string]: any };
}

const CalendarContainer = React.forwardRef(function CalendarContainer(
Expand Down
9 changes: 6 additions & 3 deletions src/DateTime.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function parseString(value) {
return value;
}

export function SimpleExamples() {
export function SimpleExamples(): JSX.Element {
function UncontrolledDateTime(props) {
const [value, setValue] = useState<any>(props.value);

Expand All @@ -57,6 +57,9 @@ export function SimpleExamples() {
console.log({ newVal });
setValue(newVal);
}}
onBlur={(newVal) => {
alert(newVal);
}}
/>
</React.StrictMode>
</div>
Expand Down Expand Up @@ -97,7 +100,7 @@ export function SimpleExamples() {
);
}

export function InlineExamples() {
export function InlineExamples(): JSX.Element {
function UncontrolledDateTime({ label, ...props }) {
const [value, setValue] = useState<any>(props.value);

Expand Down Expand Up @@ -178,7 +181,7 @@ export function InlineExamples() {
);
}

export function CustomizableExample() {
export function CustomizableExample(): JSX.Element {
const [value, setValue] = useState<any>(new Date(2019, 7, 2, 11, 25));

//
Expand Down
6 changes: 3 additions & 3 deletions src/DateTime.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2806,10 +2806,10 @@ describe("DateTime", () => {

// Tab out
userEvent.tab();
expect(element).not.toHaveFocus();

// Should have triggered "onBlur"
expect(handleBlur).toHaveBeenCalledTimes(1);
expect(element).not.toHaveFocus();
expect(handleBlur).toHaveBeenCalledWith(undefined);
});

Expand Down Expand Up @@ -2846,10 +2846,10 @@ describe("DateTime", () => {

// Tab out
userEvent.tab();
expect(element).not.toHaveFocus();

// Should have triggered "onBlur"
expect(handleBlur).toHaveBeenCalledTimes(1);
expect(element).not.toHaveFocus();
expect(handleBlur).toHaveBeenCalledWith(
new Date(2019, 0, 16, 12, 1, 12, 34)
);
Expand Down Expand Up @@ -3040,7 +3040,7 @@ describe("DateTime", () => {
expect(textContent).toMatch(/1200AM/i);
}

userEvent.type(element, "4:13 PM");
userEvent.paste(element, "4:13 PM");

// Assert the typed value is now active
expect(await findByTestId("time-picker")).toBeVisible();
Expand Down
2 changes: 1 addition & 1 deletion src/DaysView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface DaysViewProps {
isValidDate?: (date: Date) => boolean;
}

function DaysView(props: DaysViewProps) {
function DaysView(props: DaysViewProps): JSX.Element {
const {
timeFormat,
viewDate,
Expand Down
2 changes: 1 addition & 1 deletion src/MonthsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface MonthsViewProps {
isValidDate?: (date: Date) => boolean;
}

function MonthsView(props: MonthsViewProps) {
function MonthsView(props: MonthsViewProps): JSX.Element {
const {
viewDate,
setViewDate,
Expand Down
2 changes: 1 addition & 1 deletion src/TimeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export interface TimeViewProps {
timeConstraints?: TimeConstraints;
}

function TimeView(props: TimeViewProps) {
function TimeView(props: TimeViewProps): JSX.Element {
const {
viewTimestamp,
dateFormat,
Expand Down
2 changes: 1 addition & 1 deletion src/YearsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface YearsViewProps {
isValidDate?: (date: Date) => boolean;
}

function YearsView(props: YearsViewProps) {
function YearsView(props: YearsViewProps): JSX.Element {
const {
viewDate,
setViewDate,
Expand Down
8 changes: 1 addition & 7 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function DateTime(
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>
) {
): JSX.Element {
const {
isValidDate,
dateTypeMode: rawDateTypeMode,
Expand Down Expand Up @@ -429,12 +429,6 @@ function DateTime(
type: "text",
onClick: open,
onFocus: open,
onBlur: () => {
if (typeof onBlur === "function") {
const changedValue = getChangedValue(valueAsDate);
onBlur(changedValue);
}
},
onChange: onInputChange,
onKeyDown: onInputKeyDown,
value: valueStr,
Expand Down
Loading