diff --git a/client/src/client-only-routes/ShowSettings.js b/client/src/client-only-routes/ShowSettings.js index 5ff2b5e511..e5137e8ccd 100644 --- a/client/src/client-only-routes/ShowSettings.js +++ b/client/src/client-only-routes/ShowSettings.js @@ -2,7 +2,7 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; -import { Grid, Button } from '@freecodecamp/react-bootstrap'; +import { Grid } from '@freecodecamp/react-bootstrap'; import Helmet from 'react-helmet'; import envData from '../../../config/env.json'; @@ -16,7 +16,7 @@ import { submitNewAbout, updateUserFlag, verifyCert } from '../redux/settings'; import { createFlashMessage } from '../components/Flash/redux'; import { useTranslation } from 'react-i18next'; -import { FullWidthRow, Loader, Spacer } from '../components/helpers'; +import { Loader, Spacer } from '../components/helpers'; import About from '../components/settings/About'; import Privacy from '../components/settings/Privacy'; import Email from '../components/settings/Email'; @@ -132,18 +132,6 @@ export function ShowSettings(props) {
- - - -

{t('settings.for', { username: username })}

diff --git a/client/src/components/Intro/index.js b/client/src/components/Intro/index.js index 0473a00e0a..69c2934ba5 100644 --- a/client/src/components/Intro/index.js +++ b/client/src/components/Intro/index.js @@ -48,9 +48,6 @@ function Intro({ - - {t('buttons.update-settings')} - {completedChallengeCount > 0 ? ( {t('buttons.current-challenge')} diff --git a/client/src/components/profile/Profile.js b/client/src/components/profile/Profile.js index aeeed5803e..25845b5046 100644 --- a/client/src/components/profile/Profile.js +++ b/client/src/components/profile/Profile.js @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; -import { Grid, Row, Button } from '@freecodecamp/react-bootstrap'; +import { Grid, Row } from '@freecodecamp/react-bootstrap'; import Helmet from 'react-helmet'; import Link from '../helpers/Link'; import { useTranslation } from 'react-i18next'; @@ -11,9 +11,6 @@ import HeatMap from './components/HeatMap'; import Certifications from './components/Certifications'; import Portfolio from './components/Portfolio'; import Timeline from './components/TimeLine'; -import envData from '../../../../config/env.json'; - -const { apiLocation } = envData; const propTypes = { isSessionUser: PropTypes.bool, @@ -166,22 +163,6 @@ function Profile({ user, isSessionUser }) { - {isSessionUser ? ( - - - {t('buttons.update-settings')} - - - - ) : null} {isLocked ? renderMessage(isSessionUser, username, t) : null} {!isLocked || isSessionUser ? renderProfile(user) : null} diff --git a/client/src/components/profile/Profile.test.js b/client/src/components/profile/Profile.test.js index 7d509aeca9..f4eec42c1e 100644 --- a/client/src/components/profile/Profile.test.js +++ b/client/src/components/profile/Profile.test.js @@ -47,26 +47,12 @@ const userProps = { navigate: () => {} }; -const myProfileProps = { - isSessionUser: true, - ...userProps -}; - const notMyProfileProps = { isSessionUser: false, ...userProps }; describe('', () => { - it('renders the settings button on your own profile', () => { - const { getByText } = render(); - - expect(getByText('buttons.update-settings')).toHaveAttribute( - 'href', - '/settings' - ); - }); - it('renders the report button on another persons profile', () => { const { getByText } = render(); diff --git a/cypress/integration/ShowCertification.js b/cypress/integration/ShowCertification.js index 141f4b16b3..a1a1f54f85 100644 --- a/cypress/integration/ShowCertification.js +++ b/cypress/integration/ShowCertification.js @@ -3,9 +3,8 @@ describe('A certification,', function () { describe('while viewing your own,', function () { before(() => { - cy.visit('/'); - cy.contains("Get started (it's free)").click({ force: true }); - cy.contains('Update my account settings').click({ force: true }); + cy.login(); + cy.visit('/settings'); // set user settings to public to claim a cert cy.get('label:contains(Public)>input').each(el => { @@ -81,7 +80,8 @@ describe('A certification,', function () { describe("while viewing someone else's,", function () { before(() => { cy.go('back'); - cy.contains('Sign me out of freeCodeCamp').click({ force: true }); + cy.get('.toggle-button-nav').click(); + cy.get('.nav-list').contains('Sign out').click(); cy.visit('/certification/developmentuser/legacy-front-end'); }); diff --git a/cypress/integration/learn/common-components/navbar.js b/cypress/integration/learn/common-components/navbar.js index db3c6ad9e3..2c9e431fad 100644 --- a/cypress/integration/learn/common-components/navbar.js +++ b/cypress/integration/learn/common-components/navbar.js @@ -89,7 +89,6 @@ describe('Navbar', () => { it('Should have `Profile` link when user is signed in', () => { cy.login(); - cy.get('a[href*="/settings"]').should('be.visible'); cy.get(selectors.menuButton).click(); cy.get(selectors.navigationLinks).contains('Profile').click(); cy.url().should('include', '/developmentuser'); diff --git a/cypress/integration/learn/navigation-buttons/update-my-account-settings-button.js b/cypress/integration/learn/navigation-buttons/update-my-account-settings-button.js deleted file mode 100644 index 235d2bfd3c..0000000000 --- a/cypress/integration/learn/navigation-buttons/update-my-account-settings-button.js +++ /dev/null @@ -1,12 +0,0 @@ -/* global cy */ - -describe('The `Update my account settings` button works properly', function () { - beforeEach(() => { - cy.login(); - }); - - it('Should take user to their account settings when clicked', function () { - cy.contains('Update my account settings').click(); - cy.url().should('include', '/settings'); - }); -}); diff --git a/cypress/integration/settings/certifications.js b/cypress/integration/settings/certifications.js index 5d86bcd1af..1facb1d2d3 100644 --- a/cypress/integration/settings/certifications.js +++ b/cypress/integration/settings/certifications.js @@ -5,9 +5,8 @@ import '@testing-library/cypress/add-commands'; describe('Settings certifications area', () => { before(() => { cy.exec('npm run seed'); - cy.visit('/'); - cy.contains("Get started (it's free)").click({ force: true }); - cy.contains('Update my account settings').click({ force: true }); + cy.login(); + cy.visit('/settings'); }); describe('initially', () => { @@ -37,8 +36,8 @@ describe('Settings certifications area', () => { describe('after isHonest', () => { beforeEach(() => { cy.visit('/'); - cy.contains("Get started (it's free)").click({ force: true }); - cy.contains('Update my account settings').click({ force: true }); + cy.login(); + cy.visit('/settings'); }); it('Should render "You have accepted our Academic Honesty Policy." button after clicking "Agree"', () => { diff --git a/cypress/integration/settings/settings.js b/cypress/integration/settings/settings.js index 5369920a60..f9eb37bc1b 100644 --- a/cypress/integration/settings/settings.js +++ b/cypress/integration/settings/settings.js @@ -1,26 +1,8 @@ -/* global cy expect */ - +/* global cy */ describe('Settings', () => { - beforeEach(() => { + it('should be possible to visit the settings page', () => { cy.visit('/'); cy.contains("Get started (it's free)").click({ force: true }); cy.visit('/settings'); }); - - describe('The `Sign me out of freeCodeCamp` button works properly', () => { - it('Should get rendered properly', () => { - cy.contains('Sign me out of freeCodeCamp') - .should('be.visible') - // We are checking for classes here to check for proper styling - // This will be replaces with Percy in the future - .should('have.class', 'btn-invert btn btn-lg btn-primary btn-block'); - }); - - it('Should take to the landing page when clicked', () => { - cy.contains('Sign me out of freeCodeCamp').click({ force: true }); - cy.location().should(loc => { - expect(loc.pathname).to.eq('/'); - }); - }); - }); });