Skip to content

Commit

Permalink
fix(input): clear icon
Browse files Browse the repository at this point in the history
  • Loading branch information
reme3d2y committed Aug 23, 2021
1 parent 03e3223 commit 51debd4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
5 changes: 1 addition & 4 deletions packages/input/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
onClick={handleClear}
>
<span
className={cn(
styles.clearIcon,
colorStyles[colors].clearButton,
)}
className={cn(styles.clearIcon, colorStyles[colors].clearIcon)}
/>
</Button>
)}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions packages/input/src/component.screenshots.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,33 @@ describe('Input | screenshots hint and error', () => {
});
});

describe('Input | clear icon', () => {
const testCase = (theme: string, colors: string) =>
screenshotTesting({
cases: [
[
`${theme} theme`,
createSpriteStorybookUrl({
componentName: 'Input',
knobs: {
size: 'm',
clear: true,
value: 'value',
colors,
},
size: { width: 350, height: 150 },
}),
],
],
screenshotOpts: {
fullPage: true,
},
theme,
})();

['default', 'inverted'].forEach(colors => testCase('default', colors));
});

describe(
'Input | screenshots addons',
screenshotTesting({
Expand Down

0 comments on commit 51debd4

Please sign in to comment.