Fix #6497 UI : Replace arrow with Read more text (#6498)

* Fix #6497 UI : Replace arrow with `Read more` text

* Add unit test

* Fix unit test

* Fix unit test
This commit is contained in:
Sachin Chaurasiya 2022-08-02 15:41:17 +05:30 committed by GitHub
parent a878aa911c
commit ee6dbe8adb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -98,6 +98,8 @@ describe('Test BlurLayout Component', () => {
expect(displayButton).toBeInTheDocument();
expect(displayButton).toHaveTextContent('Read less');
fireEvent.click(displayButton);
expect(displayMoreHandler).toBeCalled();

View File

@ -13,7 +13,6 @@
import classNames from 'classnames';
import React, { FC } from 'react';
import SVGIcons, { Icons } from '../../../utils/SvgUtils';
import { MAX_LENGTH } from './RichTextEditorPreviewer';
interface BlurLayoutProp {
@ -51,12 +50,7 @@ export const BlurLayout: FC<BlurLayoutProp> = ({
data-testid="display-button"
onClick={displayMoreHandler}>
<span className="tw-flex tw-items-center tw-gap-2">
<SVGIcons
alt="expand-collapse"
className={classNames({ 'rotate-inverse': displayMoreText })}
icon={Icons.CHEVRON_DOWN}
width="32"
/>
{displayMoreText ? 'Read less' : 'Read more'}
</span>
</p>
</div>