fix: final confirmed product changes
This commit is contained in:
@@ -22,7 +22,9 @@ export const Dashboard = () => {
|
||||
const hasAvailableDashboards = reduxHooks.useHasAvailableDashboards();
|
||||
const initIsPending = reduxHooks.useRequestIsPending(RequestKeys.initialize);
|
||||
const showSelectSessionModal = reduxHooks.useShowSelectSessionModal();
|
||||
const shouldShowProductRecommendations = !initIsPending && !hasAvailableDashboards && hasCourses && false;
|
||||
|
||||
// Hard coded to not show until experiment set-up logic is implemented
|
||||
const showProductRecommendations = !initIsPending && !hasAvailableDashboards && hasCourses && true;
|
||||
|
||||
return (
|
||||
<div id="dashboard-container" className="d-flex flex-column p-2 pt-0">
|
||||
@@ -42,7 +44,7 @@ export const Dashboard = () => {
|
||||
</DashboardLayout>
|
||||
)}
|
||||
</div>
|
||||
{shouldShowProductRecommendations && <ProductRecommendations />}
|
||||
{showProductRecommendations && <ProductRecommendations />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -28,7 +28,7 @@ const LoadedView = ({ crossProductCourses, openCourses }) => {
|
||||
<div className="bg-light-200">
|
||||
<Container
|
||||
size="lg"
|
||||
className="recommendations-container pt-sm-5 pt-4.5 pb-2 pb-sm-4.5 bg-light-200"
|
||||
className="recommendations-container pt-sm-5 pt-4.5 pb-2 pb-sm-4.5"
|
||||
>
|
||||
<h2>
|
||||
{formatMessage(messages.recommendationsHeading)}
|
||||
|
||||
@@ -5,7 +5,7 @@ exports[`ProductRecommendations LoadedView matches snapshot 1`] = `
|
||||
className="bg-light-200"
|
||||
>
|
||||
<Container
|
||||
className="recommendations-container pt-sm-5 pt-4.5 pb-2 pb-sm-4.5 bg-light-200"
|
||||
className="recommendations-container pt-sm-5 pt-4.5 pb-2 pb-sm-4.5"
|
||||
size="lg"
|
||||
>
|
||||
<h2>
|
||||
|
||||
@@ -48,9 +48,7 @@ export const useFetchProductRecommendations = (setRequestState, setData) => {
|
||||
};
|
||||
|
||||
export const useProductRecommendationsData = () => {
|
||||
const [requestState, setRequestState] = module.state.requestState(
|
||||
RequestStates.pending
|
||||
);
|
||||
const [requestState, setRequestState] = module.state.requestState(RequestStates.pending);
|
||||
const [data, setData] = module.state.data({});
|
||||
module.useFetchProductRecommendations(setRequestState, setData);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('ProductRecommendations hooks', () => {
|
||||
expect(api.fetchProductRecommendations).toHaveBeenCalledWith(mostRecentCourseRunKey);
|
||||
});
|
||||
describe('successful fetch on mounted component', () => {
|
||||
it('sets request state to completed and loads api response', async () => {
|
||||
it('sets request state to completed and loads response', async () => {
|
||||
let resolveFn;
|
||||
api.fetchProductRecommendations.mockReturnValueOnce(new Promise(resolve => {
|
||||
resolveFn = resolve;
|
||||
@@ -95,7 +95,7 @@ describe('ProductRecommendations hooks', () => {
|
||||
});
|
||||
});
|
||||
describe('successful fetch on unmounted component', () => {
|
||||
it('it does not set the state', async () => {
|
||||
it('does not set the state', async () => {
|
||||
let resolveFn;
|
||||
api.fetchProductRecommendations.mockReturnValueOnce(new Promise(resolve => {
|
||||
resolveFn = resolve;
|
||||
@@ -127,7 +127,7 @@ describe('ProductRecommendations hooks', () => {
|
||||
state.expectInitializedWith(state.keys.requestState, RequestStates.pending);
|
||||
});
|
||||
describe('return values', () => {
|
||||
describe('request is completed, with returned response object', () => {
|
||||
describe('when the request is completed, with returned response object', () => {
|
||||
const mockResponse = { crossProductCourses: {}, amplitudeCourses: {} };
|
||||
beforeEach(() => {
|
||||
state.mockVal(state.keys.requestState, RequestStates.completed);
|
||||
@@ -147,7 +147,7 @@ describe('ProductRecommendations hooks', () => {
|
||||
expect(output.productRecommendations).toEqual(mockResponse);
|
||||
});
|
||||
});
|
||||
describe('request is pending', () => {
|
||||
describe('when the request is pending', () => {
|
||||
beforeEach(() => {
|
||||
state.mockVal(state.keys.requestState, RequestStates.pending);
|
||||
state.mockVal(state.keys.data, {});
|
||||
@@ -166,7 +166,7 @@ describe('ProductRecommendations hooks', () => {
|
||||
expect(output.productRecommendations).toEqual({});
|
||||
});
|
||||
});
|
||||
describe('request has failed', () => {
|
||||
describe('when the request has failed', () => {
|
||||
beforeEach(() => {
|
||||
state.mockVal(state.keys.requestState, RequestStates.failed);
|
||||
state.mockVal(state.keys.data, {});
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
$horizontal-card-gap: 20px;
|
||||
$vertical-card-gap: 24px;
|
||||
|
||||
// .recommendations-container {
|
||||
// border: solid;
|
||||
// }
|
||||
|
||||
.base-card {
|
||||
height: 332px;
|
||||
width: 270px !important;
|
||||
|
||||
Reference in New Issue
Block a user