Skip to content

Commit

Permalink
Merge pull request #309 from graasp/306/testsFix
Browse files Browse the repository at this point in the history
fix: fix minor test issues
  • Loading branch information
juancarlosfarah authored Aug 4, 2020
2 parents 40270d2 + d023709 commit 92fa3d8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import LanguageSelect from './common/LanguageSelect';
import DeveloperSwitch from './common/DeveloperSwitch';
import GeolocationControl from './common/GeolocationControl';
import Main from './common/Main';
import { SETTINGS_MAIN_ID } from '../config/selectors';
import { SETTINGS_MAIN_ID, SETTINGS_TITLE_ID } from '../config/selectors';
import SyncAdvancedSwitch from './space/sync/SyncAdvancedSwitch';
import StudentModeSwitch from './common/StudentModeSwitch';
import ActionEnabledSwitch from './common/ActionEnabledSwitch';
Expand Down Expand Up @@ -51,7 +51,7 @@ export class Settings extends Component {
return (
<Main id={SETTINGS_MAIN_ID}>
<div className={classes.settings}>
<Typography variant="h4" color="inherit">
<Typography variant="h4" color="inherit" id={SETTINGS_TITLE_ID}>
{t('Settings')}
</Typography>
<FormGroup>
Expand Down
1 change: 1 addition & 0 deletions src/components/__snapshots__/Settings.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ exports[`<Settings /> renders correctly 1`] = `
>
<WithStyles(ForwardRef(Typography))
color="inherit"
id="settingsTitle"
variant="h4"
>
Settings
Expand Down
1 change: 1 addition & 0 deletions src/config/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const buildCheckboxLabel = name => `checkboxLabel-${name}`;
export const EXPORT_SPACE_BUTTON_ID = 'exportSpaceButton';
export const EXPORT_SPACE_BACK_BUTTON_ID = 'exportSpaceBackButton';

export const SETTINGS_TITLE_ID = 'settingsTitle';
export const LANGUAGE_SELECT_ID = 'settingsLanguageSelect';
export const DEVELOPER_SWITCH_ID = 'settingsDeveloperSwitch';
export const GEOLOCATION_CONTROL_ID = 'settingsGeolocationControl';
Expand Down
6 changes: 3 additions & 3 deletions test/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
} from './utils';
import { createApplication, closeApplication } from './application';
import {
SETTINGS_MAIN_ID,
LANGUAGE_SELECT_ID,
GEOLOCATION_CONTROL_ID,
DEVELOPER_SWITCH_ID,
Expand All @@ -28,6 +27,7 @@ import {
SYNC_VISUAL_MAIN_ID,
SYNC_ADVANCED_MAIN_ID,
SYNC_CANCEL_BUTTON_ID,
SETTINGS_TITLE_ID,
} from '../src/config/selectors';
import {
DEFAULT_GLOBAL_TIMEOUT,
Expand Down Expand Up @@ -182,7 +182,7 @@ describe('Settings Scenarios', function() {
await menuGoToSettings(client);

// check settings screen displays in english
const settingsTitle = await client.getText(`#${SETTINGS_MAIN_ID} h5`);
const settingsTitle = await client.getText(`#${SETTINGS_TITLE_ID}`);
expect(settingsTitle).to.equal(i18n.t('Settings'));
const languageSelectTitle = await client.getText(
`#${LANGUAGE_SELECT_ID} label`
Expand All @@ -204,7 +204,7 @@ describe('Settings Scenarios', function() {
await i18n.changeLanguage('fr');

// check settings screen displays in english
const settingsTitleFr = await client.getText(`#${SETTINGS_MAIN_ID} h5`);
const settingsTitleFr = await client.getText(`#${SETTINGS_TITLE_ID}`);
expect(settingsTitleFr).to.equal(i18n.t('Settings'));
const languageSelectTitleFr = await client.getText(
`#${LANGUAGE_SELECT_ID} label`
Expand Down
2 changes: 1 addition & 1 deletion test/spaces/loadSpace.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ describe('Load Space Scenarios', function() {
await client.click(`#${LOAD_SUBMIT_BUTTON_ID}`);
await client.pause(LOAD_SELECTION_SPACE_PAUSE);

await menuGoToHome(client);
await menuGoToSavedSpaces(client);

await expectElementToExist(client, `#${SPACE_NOT_AVAILABLE_TEXT_ID}`);
})
Expand Down

0 comments on commit 92fa3d8

Please sign in to comment.