Skip to content

Commit 92ef70c

Browse files
authored
Merge pull request #727 from Lemoncode/dev
fix min textarea
2 parents 1c654c4 + 7a2dc52 commit 92ef70c

File tree

4 files changed

+52
-7
lines changed

4 files changed

+52
-7
lines changed

public/rich-components/gauge.svg

Lines changed: 4 additions & 5 deletions
Loading

src/common/components/mock-components/front-components/textarea-shape.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const textAreaShapeRestrictions: ShapeSizeRestrictions = {
1111
minWidth: 70,
1212
minHeight: 44,
1313
maxWidth: -1,
14-
maxHeight: 120,
14+
maxHeight: -1,
1515
defaultWidth: 200,
1616
defaultHeight: 55,
1717
};

src/common/components/mock-components/front-rich-components/gauge/gauge.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const Gauge = forwardRef<any, ShapeProps>((props, ref) => {
9898
y={center - fontSizeScaled / 2}
9999
width={center + 10}
100100
text={displayValue}
101-
fontFamily="Arial, sans-serif"
101+
fontFamily={BASIC_SHAPE.DEFAULT_FONT_FAMILY}
102102
fontSize={fontSizeScaled}
103103
align="center"
104104
fill={textColor}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import {
2+
extractNumbersAsTwoDigitString,
3+
endsWhithPercentageSymbol,
4+
} from './gauge.utils';
5+
6+
describe('extractNumersAsTwoDigitString', () => {
7+
it('should return 0 when input contains no numbers', () => {
8+
const input = 'abc';
9+
const result = extractNumbersAsTwoDigitString(input);
10+
expect(result).toBe('0');
11+
});
12+
it('should return 100 when input is 100', () => {
13+
const input = '100';
14+
const result = extractNumbersAsTwoDigitString(input);
15+
expect(result).toBe('100');
16+
});
17+
it('should return one number when input is one number', () => {
18+
const input = '1';
19+
const result = extractNumbersAsTwoDigitString(input);
20+
expect(result).toBe('1');
21+
});
22+
it('should return two numbers when input is two numbers', () => {
23+
const input = '12';
24+
const result = extractNumbersAsTwoDigitString(input);
25+
expect(result).toBe('12');
26+
});
27+
28+
it('should return two first numbers when input contains different characters', () => {
29+
const input = 'abc123de$f';
30+
const result = extractNumbersAsTwoDigitString(input);
31+
expect(result).toBe('12');
32+
});
33+
});
34+
35+
describe('endsWhithPercentageSymbol', () => {
36+
it('should return false when input does not end with %', () => {
37+
const input = '%abc';
38+
const result = endsWhithPercentageSymbol(input);
39+
expect(result).toBe(false);
40+
});
41+
it('should return true when input ends with %', () => {
42+
const input = 'abc%';
43+
const result = endsWhithPercentageSymbol(input);
44+
expect(result).toBe(true);
45+
});
46+
});

0 commit comments

Comments
 (0)