Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,34 @@ describe('StringDetails', () => {
})
})

it('Should add "..." in the end of the part value', async () => {
const stringDataSelectorMock = jest.fn().mockReturnValue({
value: partValue
})
stringDataSelector.mockImplementation(stringDataSelectorMock)

render(
<StringDetails
{...instance(mockedProps)}
/>
)
expect(screen.getByTestId(STRING_VALUE)).toHaveTextContent(`${bufferToString(partValue)}...`)
})

it('Should not add "..." in the end of the full value', async () => {
const stringDataSelectorMock = jest.fn().mockReturnValue({
value: fullValue
})
stringDataSelector.mockImplementation(stringDataSelectorMock)

render(
<StringDetails
{...instance(mockedProps)}
/>
)
expect(screen.getByTestId(STRING_VALUE)).toHaveTextContent(bufferToString(fullValue))
})

it('should call fetchDownloadStringValue and sendEventTelemetry after clicking on load button and download button', async () => {
const stringDataSelectorMock = jest.fn().mockReturnValue({
value: partValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const StringDetails = (props: Props) => {
const { value: formattedValue, isValid } = formattingBuffer(decompressedValue, viewFormatProp, { expanded: true })
setAreaValue(initialValueString)

setValue(formattedValue)
setValue(!isFullStringLoaded(initialValue?.data?.length, length) ? `${formattedValue}...` : formattedValue)
setIsValid(isValid)
setIsDisabled(
!isNonUnicodeFormatter(viewFormatProp, isValid)
Expand Down