-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ahtesham/VAN-1601/design
- Loading branch information
Showing
44 changed files
with
2,176 additions
and
1,841 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/components/ModalView/__snapshots__/index.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ModalView snapshot renders default ModalView 1`] = ` | ||
<div | ||
className="containers" | ||
> | ||
<ModalDialog | ||
hasCloseButton={false} | ||
isFullscreenScroll={true} | ||
isOpen={true} | ||
onClose={[MockFunction]} | ||
title="" | ||
> | ||
<ModalDialog.Header> | ||
<Component> | ||
<h3 | ||
className="mt-2" | ||
> | ||
Thank you for your interest! | ||
</h3> | ||
</Component> | ||
</ModalDialog.Header> | ||
<ModalDialog.Body> | ||
<div> | ||
<p | ||
className="mt-2" | ||
> | ||
Personalized recommendations feature is not yet available. We are working hard on bringing it to your learner home in the near future. | ||
</p> | ||
<p> | ||
Would you like to be alerted when it becomes available? | ||
</p> | ||
</div> | ||
</ModalDialog.Body> | ||
<Component> | ||
<ActionRow> | ||
<Component | ||
variant="tertiary" | ||
> | ||
Skip for now | ||
</Component> | ||
<Button | ||
variant="primary" | ||
> | ||
Count me in! | ||
</Button> | ||
</ActionRow> | ||
</Component> | ||
</ModalDialog> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import { StrictDict } from 'utils'; | ||
|
||
import * as module from './hooks'; | ||
|
||
export const state = StrictDict({ | ||
isRecommendationsModalOpen: (val) => React.useState(val), // eslint-disable-line | ||
}); | ||
|
||
export const useRecommendationsModal = () => { | ||
const [isRecommendationsModalOpen, setIsRecommendationsModalOpen] = module.state.isRecommendationsModalOpen(false); | ||
const toggleRecommendationsModal = () => setIsRecommendationsModalOpen(!isRecommendationsModalOpen); | ||
|
||
return { | ||
isRecommendationsModalOpen, | ||
toggleRecommendationsModal, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { MockUseState } from 'testUtils'; | ||
|
||
import * as hooks from './hooks'; | ||
|
||
const state = new MockUseState(hooks); | ||
|
||
const { | ||
useRecommendationsModal, | ||
} = hooks; | ||
|
||
describe('LearnerDashboardHeader hooks', () => { | ||
describe('useRecommendationsModal', () => { | ||
test('default state', () => { | ||
state.mock(); | ||
const out = useRecommendationsModal(); | ||
state.expectInitializedWith(state.keys.isRecommendationsModalOpen, false); | ||
out.toggleRecommendationsModal(); | ||
expect(state.values.isRecommendationsModalOpen).toEqual(true); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { shallow } from 'enzyme'; | ||
|
||
import ModalView from '.'; | ||
|
||
describe('ModalView', () => { | ||
const props = { | ||
isOpen: true, | ||
onClose: jest.fn(), | ||
}; | ||
describe('snapshot', () => { | ||
test('renders default ModalView', () => { | ||
const wrapper = shallow(<ModalView {...props} />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.