fix: a few typos (#279)
This commit is contained in:
@@ -39,7 +39,7 @@ describe('experiments context', () => {
|
||||
it('calls useEffect once', () => {
|
||||
expect(calls.length).toEqual(1);
|
||||
});
|
||||
describe('successfull fetch', () => {
|
||||
describe('successful fetch', () => {
|
||||
it('sets the country code', async () => {
|
||||
let resolveFn;
|
||||
api.fetchRecommendationsContext.mockReturnValueOnce(
|
||||
@@ -57,7 +57,7 @@ describe('experiments context', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('unsuccessfull fetch', () => {
|
||||
describe('unsuccessful fetch', () => {
|
||||
it('sets the country code to an empty string', async () => {
|
||||
let rejectFn;
|
||||
api.fetchRecommendationsContext.mockReturnValueOnce(
|
||||
|
||||
@@ -15,16 +15,20 @@ export const RelatedProgramsBanner = ({ cardId }) => {
|
||||
|
||||
const programData = reduxHooks.useCardRelatedProgramsData(cardId);
|
||||
|
||||
if (!programData?.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
programData?.length > 0 && (
|
||||
<Banner
|
||||
icon={Program}
|
||||
className="bg-white border-top border-bottom mb-0 related-programs-banner"
|
||||
>
|
||||
<span className="font-weight-bolder">{formatMessage(messages.relatedPrograms)}</span>
|
||||
<ProgramList programs={programData.list} />
|
||||
</Banner>
|
||||
)
|
||||
<Banner
|
||||
icon={Program}
|
||||
className="bg-white border-top border-bottom mb-0 related-programs-banner"
|
||||
>
|
||||
<span className="font-weight-bolder">
|
||||
{formatMessage(messages.relatedPrograms)}
|
||||
</span>
|
||||
<ProgramList programs={programData.list} />
|
||||
</Banner>
|
||||
);
|
||||
};
|
||||
RelatedProgramsBanner.propTypes = {
|
||||
|
||||
@@ -10,13 +10,14 @@ import useRelatedProgramsBadgeData from './hooks';
|
||||
|
||||
export const RelatedProgramsBadge = ({ cardId }) => {
|
||||
const {
|
||||
isOpen,
|
||||
openModal,
|
||||
closeModal,
|
||||
numPrograms,
|
||||
programsMessage,
|
||||
isOpen, openModal, closeModal, numPrograms, programsMessage,
|
||||
} = useRelatedProgramsBadgeData({ cardId });
|
||||
return (numPrograms > 0) && (
|
||||
|
||||
if (numPrograms === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
data-testid="RelatedProgramsBadge"
|
||||
|
||||
@@ -21,80 +21,82 @@ export const CollapseMenuBody = ({ isOpen }) => {
|
||||
const dashboard = reduxHooks.useEnterpriseDashboardData();
|
||||
const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();
|
||||
|
||||
const exploreCoursesClick = findCoursesNavDropdownClicked(urls.baseAppUrl(courseSearchUrl));
|
||||
const exploreCoursesClick = findCoursesNavDropdownClicked(
|
||||
urls.baseAppUrl(courseSearchUrl),
|
||||
);
|
||||
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
isOpen && (
|
||||
<div className="d-flex flex-column shadow-sm nav-small-menu">
|
||||
<Button as="a" href="/" variant="inverse-primary">
|
||||
{formatMessage(messages.course)}
|
||||
</Button>
|
||||
<Button as="a" href={urls.programsUrl} variant="inverse-primary">
|
||||
{formatMessage(messages.program)}
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href={urls.baseAppUrl(courseSearchUrl)}
|
||||
variant="inverse-primary"
|
||||
onClick={exploreCoursesClick}
|
||||
>
|
||||
{formatMessage(messages.discoverNew)}
|
||||
</Button>
|
||||
<WidgetNavbar placement={COLLAPSED_NAVBAR} />
|
||||
<Button as="a" href={getConfig().SUPPORT_URL} variant="inverse-primary">
|
||||
{formatMessage(messages.help)}
|
||||
</Button>
|
||||
{authenticatedUser && (
|
||||
<>
|
||||
{!!dashboard && (
|
||||
<Button as="a" href={dashboard.url} variant="inverse-primary">
|
||||
{formatMessage(messages.dashboard)}
|
||||
</Button>
|
||||
)}
|
||||
{!dashboard && getConfig().CAREER_LINK_URL && (
|
||||
<Button href={`${getConfig().CAREER_LINK_URL}`}>
|
||||
{formatMessage(messages.career)}
|
||||
<Badge className="px-2 mx-2" variant="warning">
|
||||
{formatMessage(messages.newAlert)}
|
||||
</Badge>
|
||||
</Button>
|
||||
)}
|
||||
<div className="d-flex flex-column shadow-sm nav-small-menu">
|
||||
<Button as="a" href="/" variant="inverse-primary">
|
||||
{formatMessage(messages.course)}
|
||||
</Button>
|
||||
<Button as="a" href={urls.programsUrl} variant="inverse-primary">
|
||||
{formatMessage(messages.program)}
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href={urls.baseAppUrl(courseSearchUrl)}
|
||||
variant="inverse-primary"
|
||||
onClick={exploreCoursesClick}
|
||||
>
|
||||
{formatMessage(messages.discoverNew)}
|
||||
</Button>
|
||||
<WidgetNavbar placement={COLLAPSED_NAVBAR} />
|
||||
<Button as="a" href={getConfig().SUPPORT_URL} variant="inverse-primary">
|
||||
{formatMessage(messages.help)}
|
||||
</Button>
|
||||
{authenticatedUser && (
|
||||
<>
|
||||
{!!dashboard && (
|
||||
<Button as="a" href={dashboard.url} variant="inverse-primary">
|
||||
{formatMessage(messages.dashboard)}
|
||||
</Button>
|
||||
)}
|
||||
{!dashboard && getConfig().CAREER_LINK_URL && (
|
||||
<Button href={`${getConfig().CAREER_LINK_URL}`}>
|
||||
{formatMessage(messages.career)}
|
||||
<Badge className="px-2 mx-2" variant="warning">
|
||||
{formatMessage(messages.newAlert)}
|
||||
</Badge>
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
as="a"
|
||||
href={`${getConfig().LMS_BASE_URL}/u/${authenticatedUser.username}`}
|
||||
variant="inverse-primary"
|
||||
>
|
||||
{formatMessage(messages.profile)}
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href={`${getConfig().LMS_BASE_URL}/account/settings`}
|
||||
variant="inverse-primary"
|
||||
>
|
||||
{formatMessage(messages.account)}
|
||||
</Button>
|
||||
{getConfig().ORDER_HISTORY_URL && (
|
||||
<Button
|
||||
as="a"
|
||||
href={`${getConfig().LMS_BASE_URL}/u/${
|
||||
authenticatedUser.username
|
||||
}`}
|
||||
variant="inverse-primary"
|
||||
href={getConfig().ORDER_HISTORY_URL}
|
||||
>
|
||||
{formatMessage(messages.profile)}
|
||||
{formatMessage(messages.orderHistory)}
|
||||
</Button>
|
||||
<Button
|
||||
as="a"
|
||||
href={`${getConfig().LMS_BASE_URL}/account/settings`}
|
||||
variant="inverse-primary"
|
||||
>
|
||||
{formatMessage(messages.account)}
|
||||
</Button>
|
||||
{getConfig().ORDER_HISTORY_URL && (
|
||||
<Button
|
||||
as="a"
|
||||
variant="inverse-primary"
|
||||
href={getConfig().ORDER_HISTORY_URL}
|
||||
>
|
||||
{formatMessage(messages.orderHistory)}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
as="a"
|
||||
href={getConfig().LOGOUT_URL}
|
||||
variant="inverse-primary"
|
||||
>
|
||||
{formatMessage(messages.signOut)}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
<Button
|
||||
as="a"
|
||||
href={getConfig().LOGOUT_URL}
|
||||
variant="inverse-primary"
|
||||
>
|
||||
{formatMessage(messages.signOut)}
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ exports[`CollapseMenuBody render 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`CollapseMenuBody render empty if not open 1`] = `false`;
|
||||
exports[`CollapseMenuBody render empty if not open 1`] = `null`;
|
||||
|
||||
exports[`CollapseMenuBody render unauthenticated 1`] = `
|
||||
<div
|
||||
|
||||
@@ -63,7 +63,7 @@ exports[`ConfirmEmailBanner snapshot Show on unverified 1`] = `
|
||||
<p
|
||||
className="text-center"
|
||||
>
|
||||
We've sent you an email to verify your acccount. Please check your inbox and click on the big red button to confirm and keep learning.
|
||||
We've sent you an email to verify your account. Please check your inbox and click on the big red button to confirm and keep learning.
|
||||
</p>
|
||||
</MarketingModal>
|
||||
</Fragment>
|
||||
|
||||
@@ -24,7 +24,7 @@ const messages = defineMessages({
|
||||
confirmEmailModalBody: {
|
||||
id: 'leanerDashboard.confirmEmailModalBody',
|
||||
description: 'text hint for confirming email modal',
|
||||
defaultMessage: 'We\'ve sent you an email to verify your acccount. Please check your inbox and click on the big red button to confirm and keep learning.',
|
||||
defaultMessage: 'We\'ve sent you an email to verify your account. Please check your inbox and click on the big red button to confirm and keep learning.',
|
||||
},
|
||||
confirmEmailImageAlt: {
|
||||
id: 'leanerDashboard.confirmEmailImageAlt',
|
||||
|
||||
@@ -52,4 +52,4 @@ exports[`ExpandedHeader render 1`] = `
|
||||
</header>
|
||||
`;
|
||||
|
||||
exports[`ExpandedHeader render empty if collapsed 1`] = `false`;
|
||||
exports[`ExpandedHeader render empty if collapsed 1`] = `null`;
|
||||
|
||||
@@ -19,10 +19,15 @@ export const ExpandedHeader = () => {
|
||||
const { courseSearchUrl } = reduxHooks.usePlatformSettingsData();
|
||||
const isCollapsed = useIsCollapsed();
|
||||
|
||||
const exploreCoursesClick = findCoursesNavClicked(urls.baseAppUrl(courseSearchUrl));
|
||||
const exploreCoursesClick = findCoursesNavClicked(
|
||||
urls.baseAppUrl(courseSearchUrl),
|
||||
);
|
||||
|
||||
if (isCollapsed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
!isCollapsed && (
|
||||
<header className="d-flex shadow-sm align-items-center learner-variant-header pl-4">
|
||||
<div className="flex-grow-1 d-flex align-items-center">
|
||||
<BrandLogo />
|
||||
@@ -66,7 +71,6 @@ export const ExpandedHeader = () => {
|
||||
|
||||
<AuthenticatedUserDropdown />
|
||||
</header>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"leanerDashboard.confirmEmailTextReminderBanner": "Remember to confirm your email so that you can keep learning on edX! {confirmNowButton}.",
|
||||
"leanerDashboard.verifiedConfirmEmailButton": "I've confirmed my email",
|
||||
"leanerDashboard.confirmEmailModalHeader": "Confirm your email",
|
||||
"leanerDashboard.confirmEmailModalBody": "We've sent you an email to verify your acccount. Please check your inbox and click on the big red button to confirm and keep learning.",
|
||||
"leanerDashboard.confirmEmailModalBody": "We've sent you an email to verify your account. Please check your inbox and click on the big red button to confirm and keep learning.",
|
||||
"leanerDashboard.confirmEmailImageAlt": "confirm email background",
|
||||
"learnerVariantDashboard.menu.dashboard.label": "Painel de controle",
|
||||
"learnerVariantDashboard.help.label": "Ajuda",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"leanerDashboard.confirmEmailTextReminderBanner": "Remember to confirm your email so that you can keep learning on edX! {confirmNowButton}.",
|
||||
"leanerDashboard.verifiedConfirmEmailButton": "I've confirmed my email",
|
||||
"leanerDashboard.confirmEmailModalHeader": "Confirm your email",
|
||||
"leanerDashboard.confirmEmailModalBody": "We've sent you an email to verify your acccount. Please check your inbox and click on the big red button to confirm and keep learning.",
|
||||
"leanerDashboard.confirmEmailModalBody": "We've sent you an email to verify your account. Please check your inbox and click on the big red button to confirm and keep learning.",
|
||||
"leanerDashboard.confirmEmailImageAlt": "confirm email background",
|
||||
"learnerVariantDashboard.menu.dashboard.label": "Dashboard",
|
||||
"learnerVariantDashboard.help.label": "Help",
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('ProductRecommendations', () => {
|
||||
hasFailed: false,
|
||||
};
|
||||
|
||||
const successfullLoadValues = {
|
||||
const successfulLoadValues = {
|
||||
...defaultValues,
|
||||
isLoaded: true,
|
||||
productRecommendations: mockCrossProductResponse,
|
||||
@@ -42,7 +42,7 @@ describe('ProductRecommendations', () => {
|
||||
it('matches snapshot', () => {
|
||||
hooks.useIsMobile.mockReturnValueOnce(false);
|
||||
hooks.useProductRecommendationsData.mockReturnValueOnce({
|
||||
...successfullLoadValues,
|
||||
...successfulLoadValues,
|
||||
});
|
||||
|
||||
expect(shallow(<ProductRecommendations />).snapshot).toMatchSnapshot();
|
||||
@@ -73,7 +73,7 @@ describe('ProductRecommendations', () => {
|
||||
it('renders nothing if the user is on the mobile view', () => {
|
||||
hooks.useIsMobile.mockReturnValueOnce(true);
|
||||
hooks.useProductRecommendationsData.mockReturnValueOnce({
|
||||
...successfullLoadValues,
|
||||
...successfulLoadValues,
|
||||
});
|
||||
|
||||
const wrapper = shallow(<ProductRecommendations />);
|
||||
@@ -84,7 +84,7 @@ describe('ProductRecommendations', () => {
|
||||
it('renders NoCoursesView if the request is loaded, user has courses, and the response is empty', () => {
|
||||
hooks.useIsMobile.mockReturnValueOnce(false);
|
||||
hooks.useProductRecommendationsData.mockReturnValueOnce({
|
||||
...successfullLoadValues,
|
||||
...successfulLoadValues,
|
||||
productRecommendations: {
|
||||
amplitudeCourses: [],
|
||||
crossProductCourses: [],
|
||||
@@ -100,7 +100,7 @@ describe('ProductRecommendations', () => {
|
||||
it('renders with cross product data if the request completed and the user has courses', () => {
|
||||
hooks.useIsMobile.mockReturnValueOnce(false);
|
||||
hooks.useProductRecommendationsData.mockReturnValueOnce({
|
||||
...successfullLoadValues,
|
||||
...successfulLoadValues,
|
||||
});
|
||||
|
||||
expect({ ...shallow(<ProductRecommendations />).shallowWrapper, children: expect.any(Array) }).toMatchObject(
|
||||
@@ -116,7 +116,7 @@ describe('ProductRecommendations', () => {
|
||||
it('renders the LoadedView with Amplitude course data if the request completed', () => {
|
||||
hooks.useIsMobile.mockReturnValueOnce(false);
|
||||
hooks.useProductRecommendationsData.mockReturnValueOnce({
|
||||
...successfullLoadValues,
|
||||
...successfulLoadValues,
|
||||
productRecommendations: mockAmplitudeResponse,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user