diff --git a/js/renovation/button.tsx b/js/renovation/button.tsx index 5904ff098739..6f7ddd5903b5 100644 --- a/js/renovation/button.tsx +++ b/js/renovation/button.tsx @@ -24,7 +24,7 @@ import BaseComponent from './preact-wrapper/button'; const stylingModes = ['outlined', 'text', 'contained']; const getInkRippleConfig = ({ text, icon, type }: ButtonProps) => { - const isOnlyIconButton = !text && icon || type === 'back'; + const isOnlyIconButton = (!text && icon) || (type === 'back'); const config: any = isOnlyIconButton ? { isCentered: true, useHoldAnimation: false, diff --git a/package.json b/package.json index da6a63c7baa6..c6bba5636594 100644 --- a/package.json +++ b/package.json @@ -156,7 +156,7 @@ "scripts": { "lint": "npm-run-all -p -c lint-js lint-css", "lint-js": "eslint .", - "lint-ts": "eslint ./testing/jest/**/*.ts ./testing/jest/**/*.tsx ./js/renovation/**/*.tsx ./js/renovation/**/*.ts", + "lint-ts": "eslint ./js/renovation/*.{ts,tsx} ./js/renovation/**/*.{ts,tsx} ./testing/jest/**/*.{ts,tsx}", "lint-css": "stylelint styles", "lint-staged": "lint-staged && npm run lint-ts", "build": "dotnet build build/build-dotnet.sln && gulp default", diff --git a/testing/jest/button.tests.tsx b/testing/jest/button.tests.tsx index 5878dca16328..57ef06d24fb0 100644 --- a/testing/jest/button.tests.tsx +++ b/testing/jest/button.tests.tsx @@ -1,6 +1,7 @@ import { h, createRef } from 'preact'; -import { mount, ReactWrapper, Element } from 'enzyme'; +import { mount, ReactWrapper } from 'enzyme'; +import { JSXInternal } from 'preact/src/jsx'; import devices from '../../js/core/devices'; import themes from '../../js/ui/themes'; import { @@ -17,6 +18,10 @@ import Button, { defaultOptions } from '../../js/renovation/button.p'; import type ButtonRef from '../../js/renovation/button.p'; import Icon from '../../js/renovation/icon.p'; import Widget from '../../js/renovation/widget.p'; +import type { WidgetProps } from '../../js/renovation/widget'; +import type { ButtonProps } from '../../js/renovation/button'; + +type Mock = jest.Mock; jest.mock('../../js/core/devices', () => { const actualDevices = require.requireActual('../../js/core/devices'); @@ -38,9 +43,10 @@ describe('Button', () => { const render = (props = {}): ReactWrapper => mount(