diff --git a/static/js/components/dashboard/FinalExamCard.js b/static/js/components/dashboard/FinalExamCard.js index b001080d63..7ccdae51ca 100644 --- a/static/js/components/dashboard/FinalExamCard.js +++ b/static/js/components/dashboard/FinalExamCard.js @@ -9,32 +9,33 @@ import type { Program } from "../../flow/programTypes" import type { UIState } from "../../reducers/ui" type Props = { - profile: Profile, - program: Program, - ui: UIState, + program: Program } export default class FinalExamCard extends React.Component { render() { + const { program } = this.props + if (program.exam_card_status === "") return null + return (
- +

Final Proctored Exam

To earn a certificate, you must take an online proctored exam - for each course. Before you can take a proctored exam, you - have to pay for the course and pass the online work. + for each course. Before you can take a proctored exam, you have + to pay for the course and pass the online work.

- Exams will be available online on edX.org. You may take the - exam at any time during the exam period. No advance scheduling - is required, but you should verify your account and complete - the exam onboarding during the one week onboarding period. + Exams will be available online on edX.org. You may take the exam + at any time during the exam period. No advance scheduling is + required, but you should verify your account and complete the + exam onboarding during the one week onboarding period.

diff --git a/static/js/components/dashboard/FinalExamCard_test.js b/static/js/components/dashboard/FinalExamCard_test.js index 4e3f91d16b..cc4bb014e2 100644 --- a/static/js/components/dashboard/FinalExamCard_test.js +++ b/static/js/components/dashboard/FinalExamCard_test.js @@ -5,14 +5,11 @@ import React from "react" import { mount } from "enzyme" import { assert } from "chai" import sinon from "sinon" -import IconButton from "@material-ui/core/IconButton" import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles" import FinalExamCard from "./FinalExamCard" import { DASHBOARD_RESPONSE, USER_PROFILE_RESPONSE } from "../../test_constants" -import { - PEARSON_PROFILE_ABSENT, -} from "../../constants" +import { PEARSON_PROFILE_ABSENT } from "../../constants" import { INITIAL_UI_STATE } from "../../reducers/ui" import { stringStrip, getEl } from "../../util/test_utils" import type { Program } from "../../flow/programTypes" @@ -27,21 +24,19 @@ describe("FinalExamCard", () => { sandbox = sinon.sandbox.create() const program: Program = (_.cloneDeep( DASHBOARD_RESPONSE.programs.find( - program => program.pearson_exam_status !== undefined + program => program.exam_card_status !== undefined ) ): any) props = { - profile: profile, - program: program, - ui: { ...INITIAL_UI_STATE }, + profile: profile, + program: program, + ui: { ...INITIAL_UI_STATE } } }) - const commonText = `You must take a proctored exam for each course. Exams may -be taken at any authorized Pearson test center. Before you can take an exam, you have to -pay for the course and pass the online work.` + const commonText = `To earn a certificate, you must take an online proctored exam for each + course. Before you can take a proctored exam, you have to pay for the course and pass the online work.` - const getDialog = () => document.querySelector(".dialog-to-pearson-site") const renderCard = props => mount( @@ -49,18 +44,14 @@ pay for the course and pass the online work.` ) - it("should not render when pearson_exam_status is empty", () => { + it("should not render when exam_card_status is empty", () => { const card = renderCard(props) assert.equal(card.html(), "") }) it("should just show a basic message if the profile is absent", () => { - props.program.pearson_exam_status = PEARSON_PROFILE_ABSENT + props.program.exam_card_status = PEARSON_PROFILE_ABSENT const card = renderCard(props) assert.include(stringStrip(card.text()), stringStrip(commonText)) - assert.notInclude( - stringStrip(card.text()), - "Your Pearson Testing account has been created" - ) }) }) diff --git a/static/js/factories/dashboard.js b/static/js/factories/dashboard.js index 7565ce1df4..4dd60277e7 100644 --- a/static/js/factories/dashboard.js +++ b/static/js/factories/dashboard.js @@ -129,7 +129,7 @@ export const makeProgram = (): Program => { min_possible_cost: 1000, id: newFinancialAidId() }, - pearson_exam_status: + exam_card_status: PEARSON_STATUSES[Math.floor(Math.random() * PEARSON_STATUSES.length)], grade_average: Math.floor(Math.random() * 100), certificate: "", diff --git a/static/js/flow/programTypes.js b/static/js/flow/programTypes.js index 6a92a94c91..0a4e9037d8 100644 --- a/static/js/flow/programTypes.js +++ b/static/js/flow/programTypes.js @@ -34,7 +34,7 @@ export type Program = { title: string, financial_aid_availability: boolean, financial_aid_user_info: FinancialAidUserInfo, - pearson_exam_status: string, + exam_card_status: string, grade_average: ?number, certificate: string, grade_records_url: string, diff --git a/static/js/global_init.js b/static/js/global_init.js index a604babcb9..d74fae2f5a 100644 --- a/static/js/global_init.js +++ b/static/js/global_init.js @@ -15,12 +15,12 @@ const _createSettings = () => ({ last_name: "Doe", preferred_name: "JD" }, - edx_base_url: "/edx/", - search_url: "/", - roles: [], - support_email: "a_real_email@example.com", - es_page_size: 40, - FEATURES: { + edx_base_url: "/edx/", + search_url: "/", + roles: [], + support_email: "a_real_email@example.com", + es_page_size: 40, + FEATURES: { PROGRAM_LEARNERS: true, DISCUSSIONS_POST_UI: true, DISCUSSIONS_CREATE_CHANNEL_UI: true, diff --git a/static/js/test_constants.js b/static/js/test_constants.js index 74bec1dd69..b183b7a968 100644 --- a/static/js/test_constants.js +++ b/static/js/test_constants.js @@ -1280,10 +1280,10 @@ export const DASHBOARD_RESPONSE: Dashboard = deepFreeze({ id: 2 }, { - title: "Last program", - description: "The last program", - pearson_exam_status: "", - courses: [ + title: "Last program", + description: "The last program", + exam_card_status: "", + courses: [ { id: 13, position_in_program: 0,