Skip to content

Commit

Permalink
chore: #183 add what new section on help page (#278)
Browse files Browse the repository at this point in the history
* chore: #183 add what's new section on developer help page

* chore: #271 hide terms and conditions checkbox on submit and edit app

* chore: fix linter

* chore: fix hidden test for term and conditions submit page

* chore: fix lint and test
  • Loading branch information
dannd4 authored Feb 14, 2020
1 parent 357960c commit 86adb5c
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 157 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -281,77 +281,81 @@ exports[`DeveloperWelcomeMessage Welcome step should match a snapshot 1`] = `
`;

exports[`DeveloperWelcomeMessage should match a snapshot 1`] = `
<Component
className="welcome-container"
flexColumn={true}
hasBackground={true}
hasPadding={true}
<div
id="developer-welcome"
>
<Component>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-1"
src=""
/>
}
heading="Welcome to Reapit Foundations"
id="step-1"
subHeading="Let’s get started."
/>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-2"
src=""
/>
}
heading="Documentation"
id="step-2"
subHeading="We’ve got you covered."
/>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-3"
src=""
/>
}
heading="Submitting an App"
id="step-3"
subHeading="Nearly there."
/>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-4"
src=""
/>
}
heading="Managing your App"
id="step-4"
subHeading="Installations and changes."
/>
<HelpGuideStep
graphic={
<img
alt="step-5"
src=""
/>
}
heading="On going support"
id="step-5"
render={
<Unknown
onAccept={[MockFunction]}
/>
}
subHeading="We’re here to help."
/>
<Component
className="welcome-container"
flexColumn={true}
hasBackground={true}
hasPadding={true}
>
<Component>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-1"
src=""
/>
}
heading="Welcome to Reapit Foundations"
id="step-1"
subHeading="Let’s get started."
/>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-2"
src=""
/>
}
heading="Documentation"
id="step-2"
subHeading="We’ve got you covered."
/>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-3"
src=""
/>
}
heading="Submitting an App"
id="step-3"
subHeading="Nearly there."
/>
<HelpGuideStep
component={[Function]}
graphic={
<img
alt="step-4"
src=""
/>
}
heading="Managing your App"
id="step-4"
subHeading="Installations and changes."
/>
<HelpGuideStep
graphic={
<img
alt="step-5"
src=""
/>
}
heading="On going support"
id="step-5"
render={
<Unknown
onAccept={[MockFunction]}
/>
}
subHeading="We’re here to help."
/>
</Component>
</Component>
</Component>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,43 @@ exports[`HelpPage should match a snapshot 1`] = `
</p>
</Component>
</Component>
<Component
key="What’s New"
>
<Component
centerContent={true}
flexColumn={true}
hasPadding={true}
>
<div>
<img
alt="What’s New"
src=""
/>
</div>
<Component
isCentered={true}
>
What’s New
</Component>
<p>
We are constantly working to improve your experience with the Foundations Platform. Have a look to see what
new features and fixes have been released.
</p>
<p>
<Component
disabled={false}
fullWidth={false}
loading={false}
onClick={[Function]}
type="button"
variant="primary"
>
VIEW
</Component>
</p>
</Component>
</Component>
</Component>
</div>
`;
Expand Down Expand Up @@ -368,5 +405,40 @@ exports[`renderHelpItems should match snapshot 1`] = `
</p>
</Unknown>
</Unknown>
<Unknown>
<Unknown
centerContent={true}
flexColumn={true}
hasPadding={true}
>
<div>
<img
alt="What’s New"
src=""
/>
</div>
<Unknown
isCentered={true}
>
What’s New
</Unknown>
<p>
We are constantly working to improve your experience with the Foundations Platform. Have a look to see what
new features and fixes have been released.
</p>
<p>
<Unknown
disabled={false}
fullWidth={false}
loading={false}
onClick={[Function]}
type="button"
variant="primary"
>
VIEW
</Unknown>
</p>
</Unknown>
</Unknown>
</Unknown>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
handleSubmitApp,
handleClickOpenModal,
handleCloseModal,
handleAcceptTerms,
handleDeclineTerms,
// handleAcceptTerms,
// handleDeclineTerms,
CustomCreateAppModel,
} from '../developer-submit-app'
import { appDetailDataStub } from '../../../sagas/__stubs__/app-detail'
Expand Down Expand Up @@ -413,19 +413,19 @@ describe('handleSubmitApp', () => {
submitApp: jest.fn(),
submitRevision: jest.fn(),
setSubmitError: jest.fn(),
isAgreedTerms: false,
setShouldShowError: jest.fn(),
// isAgreedTerms: false,
// setShouldShowError: jest.fn(),
}
const appModel = { redirectUris: '' } as CustomCreateAppModel
const actions = {} as any
afterEach(() => jest.clearAllMocks())
it('should call setShouldShowError when not agree', () => {
const params = { ...paramsBase }
const spy = jest.spyOn(params, 'setShouldShowError')
const fn = handleSubmitApp(params)
fn(appModel, actions)
expect(spy).toHaveBeenCalledWith(true)
})
// it('should call setShouldShowError when not agree', () => {
// const params = { ...paramsBase }
// const spy = jest.spyOn(params, 'setShouldShowError')
// const fn = handleSubmitApp(params)
// fn(appModel, actions)
// expect(spy).toHaveBeenCalledWith(true)
// })
it('should call submitApp when dont have appId', () => {
const params = { ...paramsBase, appId: null, isAgreedTerms: true }
const spy = jest.spyOn(params, 'submitApp')
Expand Down Expand Up @@ -460,21 +460,21 @@ describe('handleCloseModal', () => {
expect(setTermModalIsOpen).toHaveBeenCalledWith(false)
})
})
describe('handleAcceptTerms', () => {
it('should call setIsAgreedTerms and setTermModalIsOpen', () => {
const setTermModalIsOpen = jest.fn()
const setIsAgreedTerms = jest.fn()
handleAcceptTerms(setIsAgreedTerms, setTermModalIsOpen)()
expect(setIsAgreedTerms).toHaveBeenCalledWith(true)
expect(setTermModalIsOpen).toHaveBeenCalledWith(false)
})
})
describe('handleDeclineTerms', () => {
it('should call preventDefault and setTermModalIsOpen', () => {
const setTermModalIsOpen = jest.fn()
const setIsAgreedTerms = jest.fn()
handleDeclineTerms(setIsAgreedTerms, setTermModalIsOpen)()
expect(setIsAgreedTerms).toHaveBeenCalledWith(false)
expect(setTermModalIsOpen).toHaveBeenCalledWith(false)
})
})
// describe('handleAcceptTerms', () => {
// it('should call setIsAgreedTerms and setTermModalIsOpen', () => {
// const setTermModalIsOpen = jest.fn()
// const setIsAgreedTerms = jest.fn()
// handleAcceptTerms(setIsAgreedTerms, setTermModalIsOpen)()
// expect(setIsAgreedTerms).toHaveBeenCalledWith(true)
// expect(setTermModalIsOpen).toHaveBeenCalledWith(false)
// })
// })
// describe('handleDeclineTerms', () => {
// it('should call preventDefault and setTermModalIsOpen', () => {
// const setTermModalIsOpen = jest.fn()
// const setIsAgreedTerms = jest.fn()
// handleDeclineTerms(setIsAgreedTerms, setTermModalIsOpen)()
// expect(setIsAgreedTerms).toHaveBeenCalledWith(false)
// expect(setTermModalIsOpen).toHaveBeenCalledWith(false)
// })
// })
Loading

0 comments on commit 86adb5c

Please sign in to comment.