Skip to content

Commit 79e8a5c

Browse files
authored
Merge pull request #3641 from Paulie-Aditya/develop
feat: fixed word wrap preference issue
2 parents 3ba269a + aec9026 commit 79e8a5c

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

client/modules/IDE/components/Preferences/Preferences.unit.test.jsx

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -442,43 +442,44 @@ describe('<Preferences />', () => {
442442
);
443443
});
444444
});
445-
describe('start wordwrap at false', () => {
446-
it('wordwrap toggle, starting at false', () => {
447-
// render the component with wordwrap prop set to false
448-
subject({ wordwrap: false });
449-
450-
// get ahold of the radio buttons for toggling wordwrap
451-
const wordwrapRadioFalse = screen.getByRole('radio', {
445+
// TODO: Consolidate "linewrap" (reference from backend/User model) and "word wrap" (currently used in UI) into consistent naming.
446+
describe('start linewrap at false', () => {
447+
it('linewrap toggle, starting at false', () => {
448+
// render the component with linewrap prop set to false
449+
subject({ linewrap: false });
450+
451+
// get ahold of the radio buttons for toggling linewrap
452+
const linewrapRadioFalse = screen.getByRole('radio', {
452453
name: /wordwrap off/i
453454
});
454-
const wordwrapRadioTrue = screen.getByRole('radio', {
455+
const linewrapRadioTrue = screen.getByRole('radio', {
455456
name: /wordwrap on/i
456457
});
457458

458459
testToggle(
459-
wordwrapRadioFalse,
460-
wordwrapRadioTrue,
460+
linewrapRadioFalse,
461+
linewrapRadioTrue,
461462
props.setLinewrap,
462463
true
463464
);
464465
});
465466
});
466-
describe('start wordwrap at true', () => {
467-
it('wordwrap toggle, starting at true', () => {
468-
// render the component with wordwrap prop set to true
469-
subject({ wordwrap: true });
467+
describe('start linewrap at true', () => {
468+
it('linewrap toggle, starting at true', () => {
469+
// render the component with linewrap prop set to true
470+
subject({ linewrap: true });
470471

471-
// get ahold of the radio buttons for toggling wordwrap
472-
const wordwrapRadioFalse = screen.getByRole('radio', {
472+
// get ahold of the radio buttons for toggling linewrap
473+
const linewrapRadioFalse = screen.getByRole('radio', {
473474
name: /wordwrap off/i
474475
});
475-
const wordwrapRadioTrue = screen.getByRole('radio', {
476+
const linewrapRadioTrue = screen.getByRole('radio', {
476477
name: /wordwrap on/i
477478
});
478479

479480
testToggle(
480-
wordwrapRadioTrue,
481-
wordwrapRadioFalse,
481+
linewrapRadioTrue,
482+
linewrapRadioFalse,
482483
props.setLinewrap,
483484
false
484485
);

client/modules/IDE/components/Preferences/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default function Preferences() {
4343
tabIndex,
4444
fontSize,
4545
autosave,
46-
wordwrap,
46+
linewrap,
4747
lineNumbers,
4848
lintWarning,
4949
textOutput,
@@ -398,7 +398,7 @@ export default function Preferences() {
398398
id="wordwrap-on"
399399
className="preference__radio-button"
400400
value="On"
401-
checked={wordwrap}
401+
checked={linewrap}
402402
/>
403403
<label htmlFor="wordwrap-on" className="preference__option">
404404
{t('Preferences.On')}
@@ -411,7 +411,7 @@ export default function Preferences() {
411411
id="wordwrap-off"
412412
className="preference__radio-button"
413413
value="Off"
414-
checked={!wordwrap}
414+
checked={!linewrap}
415415
/>
416416
<label htmlFor="wordwrap-off" className="preference__option">
417417
{t('Preferences.Off')}

0 commit comments

Comments
 (0)