Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
46 changes: 23 additions & 23 deletions client/modules/IDE/components/Preferences/Preferences.unit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,43 +442,43 @@ describe('<Preferences />', () => {
);
});
});
describe('start wordwrap at false', () => {
it('wordwrap toggle, starting at false', () => {
// render the component with wordwrap prop set to false
subject({ wordwrap: false });
describe('start linewrap at false', () => {
it('linewrap toggle, starting at false', () => {
// render the component with linewrap prop set to false
subject({ linewrap: false });

// get ahold of the radio buttons for toggling wordwrap
const wordwrapRadioFalse = screen.getByRole('radio', {
name: /wordwrap off/i
// get ahold of the radio buttons for toggling linewrap
const linewrapRadioFalse = screen.getByRole('radio', {
name: /linewrap off/i
});
const wordwrapRadioTrue = screen.getByRole('radio', {
name: /wordwrap on/i
const linewrapRadioTrue = screen.getByRole('radio', {
name: /linewrap on/i
});

testToggle(
wordwrapRadioFalse,
wordwrapRadioTrue,
linewrapRadioFalse,
linewrapRadioTrue,
props.setLinewrap,
true
);
});
});
describe('start wordwrap at true', () => {
it('wordwrap toggle, starting at true', () => {
// render the component with wordwrap prop set to true
subject({ wordwrap: true });
describe('start linewrap at true', () => {
it('linewrap toggle, starting at true', () => {
// render the component with linewrap prop set to true
subject({ linewrap: true });

// get ahold of the radio buttons for toggling wordwrap
const wordwrapRadioFalse = screen.getByRole('radio', {
name: /wordwrap off/i
// get ahold of the radio buttons for toggling linewrap
const linewrapRadioFalse = screen.getByRole('radio', {
name: /linewrap off/i
});
const wordwrapRadioTrue = screen.getByRole('radio', {
name: /wordwrap on/i
const linewrapRadioTrue = screen.getByRole('radio', {
name: /linewrap on/i
});

testToggle(
wordwrapRadioTrue,
wordwrapRadioFalse,
linewrapRadioTrue,
linewrapRadioFalse,
props.setLinewrap,
false
);
Expand Down Expand Up @@ -511,7 +511,7 @@ describe('<Preferences />', () => {
});

const generalElement1 = screen.getByRole('radio', {
name: /wordwrap on/i
name: /linewrap on/i
});
expect(generalElement1).toBeInTheDocument();
});
Expand Down
6 changes: 3 additions & 3 deletions client/modules/IDE/components/Preferences/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Preferences() {
tabIndex,
fontSize,
autosave,
wordwrap,
linewrap,
lineNumbers,
lintWarning,
textOutput,
Expand Down Expand Up @@ -398,7 +398,7 @@ export default function Preferences() {
id="wordwrap-on"
className="preference__radio-button"
value="On"
checked={wordwrap}
checked={linewrap}
/>
<label htmlFor="wordwrap-on" className="preference__option">
{t('Preferences.On')}
Expand All @@ -411,7 +411,7 @@ export default function Preferences() {
id="wordwrap-off"
className="preference__radio-button"
value="Off"
checked={!wordwrap}
checked={!linewrap}
/>
<label htmlFor="wordwrap-off" className="preference__option">
{t('Preferences.Off')}
Expand Down