Skip to content

Commit 4a0f666

Browse files
irinaAbramova-devirinaP-local
authored andcommitted
#RI-4815 fix max length value
1 parent 49c04bb commit 4a0f666

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

redisinsight/ui/src/pages/browser/components/string-details/StringDetails.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ const LOAD_ALL_BTN = 'load-all-value-btn'
2424
const DOWNLOAD_BTN = 'download-all-value-btn'
2525

2626
const STRING_MAX_LENGTH = 2
27-
const STRING_LENGTH = 3
27+
const STRING_LENGTH = 4
2828

29-
const fullValue = { type: 'Buffer', data: [49, 50, 51], }
29+
const fullValue = { type: 'Buffer', data: [49, 50, 51, 52], }
3030
const partValue = { type: 'Buffer', data: [49, 50], }
3131

3232
const mockedProps = mock<Props>()
@@ -182,7 +182,7 @@ describe('StringDetails', () => {
182182
fireEvent.click(screen.getByTestId(LOAD_ALL_BTN))
183183

184184
expect(onRefresh).toBeCalled()
185-
expect(onRefresh).toBeCalledWith(fullValue, 'string', { end: STRING_MAX_LENGTH })
185+
expect(onRefresh).toBeCalledWith(fullValue, 'string', { end: STRING_MAX_LENGTH + 1 })
186186
expect(sendEventTelemetry).toBeCalled()
187187
expect(sendEventTelemetry).toBeCalledWith({
188188
event: TelemetryEvent.STRING_LOAD_ALL_CLICKED,

redisinsight/ui/src/pages/browser/components/string-details/StringDetails.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import styles from './styles.module.scss'
5454
const MAX_ROWS = 25
5555
const MIN_ROWS = 4
5656
const APPROXIMATE_WIDTH_OF_SIGN = 8.6
57+
const MAX_LENGTH = STRING_MAX_LENGTH + 1
5758

5859
export interface Props {
5960
isEditItem: boolean;
@@ -258,7 +259,7 @@ const StringDetails = (props: Props) => {
258259
)}
259260
</div>
260261

261-
{length > STRING_MAX_LENGTH && (
262+
{length > MAX_LENGTH && (
262263
<div className="key-details-footer" key="key-details-footer">
263264
<EuiFlexGroup
264265
gutterSize="none"

0 commit comments

Comments
 (0)