Merge pull request #2058 from NguyenTranHoangSym/SDA-4440

SDA-4440: Restore size for non line break words
This commit is contained in:
NguyenTranHoangSym 2024-01-04 15:33:40 +07:00 committed by GitHub
commit 881f596778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 2 deletions

View File

@ -53,7 +53,7 @@ exports[`about app should render correctly 1`] = `
title="Close" title="Close"
> >
<span <span
className="AboutApp-button-save-restart-text" className=""
> >
Close Close
</span> </span>

View File

@ -156,4 +156,32 @@ describe('about app', () => {
podInput.simulate('mousedown'); podInput.simulate('mousedown');
expect(wrapper.find(`[data-testid="POD_INFO"]`).exists()).toEqual(true); expect(wrapper.find(`[data-testid="POD_INFO"]`).exists()).toEqual(true);
}); });
it('should shrink text if its save and close', () => {
const cloneAboutDataMock = {
...aboutDataMockState,
finalConfig: { url: 'bcd.symphony.com' },
};
cloneAboutDataMock.globalConfig = { isPodUrlEditable: true };
cloneAboutDataMock.userConfig = { isPodUrlEditable: false };
const wrapper = shallow(React.createElement(AboutApp));
ipcRenderer.send('about-app-data', cloneAboutDataMock);
const pod = wrapper.find(`[data-testid="POD_INFO"]`);
pod.simulate('click', { detail: 1 });
pod.simulate('click', { detail: 2 });
pod.simulate('click', { detail: 3 });
const inputPod = wrapper.find(`[data-testid="POD_INFO_INPUT"]`);
inputPod.simulate('keydown', {
target: { value: 'pod.symphony.com' },
keyCode: 13,
});
expect(
wrapper
.find(`[data-testid="CLOSE_BUTTON"] span`)
.hasClass('AboutApp-button-save-restart-text'),
).toBe(true);
});
}); });

View File

@ -220,7 +220,11 @@ export default class AboutApp extends React.Component<{}, IState> {
ref={this.closeButtonRef} ref={this.closeButtonRef}
disabled={!isValidHostname} disabled={!isValidHostname}
> >
<span className='AboutApp-button-save-restart-text'> <span
className={classNames({
'AboutApp-button-save-restart-text': isHostNamechanged,
})}
>
{closeButtonText} {closeButtonText}
</span> </span>
</button> </button>
@ -410,6 +414,7 @@ export default class AboutApp extends React.Component<{}, IState> {
<strong className={'AboutApp-pod'}>{item.key}</strong> <strong className={'AboutApp-pod'}>{item.key}</strong>
{isPodEditing ? ( {isPodEditing ? (
<input <input
data-testid={'POD_INFO_INPUT'}
className={'AboutApp-pod-input'} className={'AboutApp-pod-input'}
type='text' type='text'
value={updatedHostname} value={updatedHostname}