Skip to content

Commit

Permalink
Merge branch 'master' into OCRVS-1712
Browse files Browse the repository at this point in the history
  • Loading branch information
maacpiash committed Jul 10, 2019
2 parents bce9e85 + d3ffc58 commit 95ce46b
Show file tree
Hide file tree
Showing 14 changed files with 409 additions and 485 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/forms/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const StyledTextArea = styled.textarea<ITextAreaProps>`
width: 100%;
padding: 10px;
min-height: 80px;
border: 2px solid ${({ theme }) => theme.colors.secondary};
border: 2px solid ${({ theme }) => theme.colors.menuBackground};
&:focus {
box-shadow: 0 0 0px 2px ${({ theme }) => theme.colors.focus};
outline: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const DataContainer = styled.div`
const Label = styled.label`
${({ theme }) => theme.fonts.bigBodyBoldStyle};
flex: 1;
margin-right: 16px;
max-width: 40%;
`
const Value = styled.div`
${({ theme }) => theme.fonts.bigBodyStyle};
Expand All @@ -50,7 +52,7 @@ interface IAction {
export interface IDataProps {
id?: string
label: string
value?: string
value?: React.ReactNode
placeHolder?: string
action?: IAction
}
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/components/layout/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ export const Container = styled.div`
min-height: calc(100vh - 40px);
width: 100%;
`
export const FullBodyContent = styled.div`
flex: 1;
width: 100%;
height: 100%;
padding: 24px;
`
12 changes: 6 additions & 6 deletions packages/e2e/cypress/integration/birth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ context('Birth Registration Integration Test', () => {
cy.wait(1000)
cy.get('#next_section').click()
// PREVIEW
cy.get('#next_button_child').click()
cy.get('#next_button_mother').click()
cy.get('#next_button_father').click()
// cy.get('#next_button_child').click()
// cy.get('#next_button_mother').click()
// cy.get('#next_button_father').click()
cy.get('#submit_form').click()
// MODAL
cy.get('#submit_confirm').click()
Expand Down Expand Up @@ -206,9 +206,9 @@ context('Birth Registration Integration Test', () => {
cy.wait(1000)
cy.get('#next_section').click()
// PREVIEW
cy.get('#next_button_child').click()
cy.get('#next_button_mother').click()
cy.get('#next_button_father').click()
// cy.get('#next_button_child').click()
// cy.get('#next_button_mother').click()
// cy.get('#next_button_father').click()
cy.get('#submit_form').click()
// MODAL
cy.get('#submit_confirm').click()
Expand Down
18 changes: 11 additions & 7 deletions packages/e2e/cypress/integration/death.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ context('Death Registration Integration Test', () => {
cy.wait(1000)
cy.get('#next_section').click()
// PREVIEW
cy.get('#next_button_deceased').click()
cy.get('#next_button_informant').click()
cy.get('#next_button_deathEvent').click()
// cy.get('#next_button_deceased').click()
// cy.get('#next_button_informant').click()
// cy.get('#next_button_deathEvent').click()
cy.get('#submit_form').click()
// MODAL
cy.get('#submit_confirm').click()
Expand Down Expand Up @@ -176,7 +176,11 @@ context('Death Registration Integration Test', () => {
// cy.get('#applicantBirthDate-dd').type('17')
// cy.get('#applicantBirthDate-mm').type('10')
// cy.get('#applicantBirthDate-yyyy').type('1956')
cy.selectOption('#applicantsRelationToDeceased', 'Extended Family', 'Extended Family')
cy.selectOption(
'#applicantsRelationToDeceased',
'Extended Family',
'Extended Family'
)
cy.get('#applicantPhone').type('01712345678')
cy.selectOption('#country', 'Bangladesh', 'Bangladesh')
cy.selectOption('#state', 'Dhaka', 'Dhaka')
Expand Down Expand Up @@ -228,9 +232,9 @@ context('Death Registration Integration Test', () => {
cy.wait(1000)
cy.get('#next_section').click()
// PREVIEW
cy.get('#next_button_deceased').click()
cy.get('#next_button_informant').click()
cy.get('#next_button_deathEvent').click()
// cy.get('#next_button_deceased').click()
// cy.get('#next_button_informant').click()
// cy.get('#next_button_deathEvent').click()
cy.get('#submit_form').click()
// MODAL
cy.get('#submit_confirm').click()
Expand Down
6 changes: 6 additions & 0 deletions packages/register/src/i18n/locales/bn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,12 @@ export const BENGALI_STATE: ILanguage = {
'review.documentViewer.title': 'প্রমাণক ডকুমেন্ট',
'review.documentViewer.tagline': 'প্রিভিউ বাছাই করুন',
'review.form.deleteApplication': 'আবেদন বাতিল',
'review.header.title.govtName.bgd': 'গণপ্রজাতন্ত্রী বাংলাদেশ সরকার',
'review.header.subject.subjectWithoutName':
'{eventType, select, birth {জন্ম} death {মৃত্যু}} আবেদন',
'review.header.subject.subjectWitName':
'{name} এর জন্য {eventType, select, birth {জন্ম} death {মৃত্যু}} আবেদন',
'review.inputs.additionalComments': 'কোন মন্তব্য?',
'app.logout.modal.no': 'না',
'app.logout.modal.yes': 'হ্যাঁ',
'app.logout.modal.confirmationText': 'আপনি কি লগ আউট করতে চান?',
Expand Down
7 changes: 7 additions & 0 deletions packages/register/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,13 @@ export const ENGLISH_STATE: ILanguage = {
'review.documentViewer.title': 'Supporting Documents',
'review.documentViewer.tagline': 'Select to Preview',
'review.form.deleteApplication': 'Delete Application',
'review.header.title.govtName.bgd':
'Government of the peoples republic of Bangladesh',
'review.header.subject.subjectWithoutName':
'{eventType, select, birth {Birth} death {Death}} Application',
'review.header.subject.subjectWitName':
'{eventType, select, birth {Birth} death {Death}} Application for {name}',
'review.inputs.additionalComments': 'Any additional comments?',
'app.logout.modal.no': 'No',
'app.logout.modal.yes': 'Yes',
'app.logout.modal.confirmationText': 'Are you sure you wish to log out?',
Expand Down

Large diffs are not rendered by default.

106 changes: 2 additions & 104 deletions packages/register/src/views/RegisterForm/PreviewForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,26 +221,9 @@ describe('when user is previewing the form data', () => {
.find('#submit_form')
.hostNodes()
.prop('disabled')
).toBe(true)
).toBe(false)
})
describe('All sections visited', () => {
beforeEach(async () => {
app
.find('#next_button_child')
.hostNodes()
.simulate('click')
app
.find('#next_button_mother')
.hostNodes()
.simulate('click')
app
.find('#next_button_father')
.hostNodes()
.simulate('click')
await flushPromises()
app.update()
})

it('Should be able to click SEND FOR REVIEW Button', () => {
expect(
app
Expand Down Expand Up @@ -440,51 +423,13 @@ describe('when user is previewing the form data', () => {

it('successfully submits the review form', async () => {
jest.setMock('react-apollo', { default: ReactApollo })
app
.find('#next_button_child')
.hostNodes()
.simulate('click')

app
.find('#next_button_mother')
.hostNodes()
.simulate('click')

app
.find('#next_button_father')
.hostNodes()
.simulate('click')

app
.find('#registerApplicationBtn')
.hostNodes()
.simulate('click')

app
.find('#register_confirm')
.hostNodes()
.simulate('click')

await flushPromises()
app.update()
})

it('preview link will close the modal', async () => {
jest.setMock('react-apollo', { default: ReactApollo })
app
.find('#next_button_child')
.hostNodes()
.simulate('click')

app
.find('#next_button_mother')
.hostNodes()
.simulate('click')

app
.find('#next_button_father')
.hostNodes()
.simulate('click')

app
.find('#registerApplicationBtn')
Expand All @@ -503,20 +448,6 @@ describe('when user is previewing the form data', () => {
})
it('rejecting application redirects to home screen', async () => {
jest.setMock('react-apollo', { default: ReactApollo })
app
.find('#next_button_child')
.hostNodes()
.simulate('click')

app
.find('#next_button_mother')
.hostNodes()
.simulate('click')

app
.find('#next_button_father')
.hostNodes()
.simulate('click')

app
.find('#rejectApplicationBtn')
Expand Down Expand Up @@ -548,12 +479,7 @@ describe('when user is previewing the form data', () => {
app.update()

expect(store.dispatch).toBeCalled()
// expect(
// app
// .find('#submission_text')
// .hostNodes()
// .text()
// ).toEqual('birth application has been rejected.')
expect(history.location.pathname).toEqual('/')
})
})
describe('when user is in the death review section', () => {
Expand Down Expand Up @@ -717,20 +643,6 @@ describe('when user is previewing the form data', () => {

it('successfully submits the review form', async () => {
jest.setMock('react-apollo', { default: ReactApollo })
app
.find('#next_button_deceased')
.hostNodes()
.simulate('click')

app
.find('#next_button_informant')
.hostNodes()
.simulate('click')

app
.find('#next_button_deathEvent')
.hostNodes()
.simulate('click')

app
.find('#registerApplicationBtn')
Expand All @@ -747,20 +659,6 @@ describe('when user is previewing the form data', () => {
})
it('rejecting application redirects to reject confirmation screen', async () => {
jest.setMock('react-apollo', { default: ReactApollo })
app
.find('#next_button_deceased')
.hostNodes()
.simulate('click')

app
.find('#next_button_informant')
.hostNodes()
.simulate('click')

app
.find('#next_button_deathEvent')
.hostNodes()
.simulate('click')

app
.find('#rejectApplicationBtn')
Expand Down
55 changes: 0 additions & 55 deletions packages/register/src/views/RegisterForm/RegisterForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -930,20 +930,6 @@ describe('when user is in the register form preview section', () => {
})

it('should be able to submit the form', () => {
const nextForChildSectionBtn = component
.find('#next_button_child')
.hostNodes()
const nextForMotherSectionBtn = component
.find('#next_button_mother')
.hostNodes()
const nextForFatherSectionBtn = component
.find('#next_button_father')
.hostNodes()

nextForChildSectionBtn.simulate('click')
nextForMotherSectionBtn.simulate('click')
nextForFatherSectionBtn.simulate('click')

component
.find('#submit_form')
.hostNodes()
Expand Down Expand Up @@ -1016,21 +1002,6 @@ describe('when user is in the register form review section', () => {
})

it('clicking the reject button launches the reject form action page', () => {
component
.find('#next_button_child')
.hostNodes()
.simulate('click')

component
.find('#next_button_mother')
.hostNodes()
.simulate('click')

component
.find('#next_button_father')
.hostNodes()
.simulate('click')

component
.find('#rejectApplicationBtn')
.hostNodes()
Expand Down Expand Up @@ -1149,19 +1120,6 @@ describe('When user is in Preview section death event', async () => {
})

it('Should be able to submit the form', () => {
component
.find('#next_button_deceased')
.hostNodes()
.simulate('click')
component
.find('#next_button_informant')
.hostNodes()
.simulate('click')
component
.find('#next_button_deathEvent')
.hostNodes()
.simulate('click')

component
.find('#submit_form')
.hostNodes()
Expand Down Expand Up @@ -1257,19 +1215,6 @@ describe('When user is in Preview section death event in offline mode', async ()
})

it('Should be able to submit the form', async () => {
component
.find('#next_button_deceased')
.hostNodes()
.simulate('click')
component
.find('#next_button_informant')
.hostNodes()
.simulate('click')
component
.find('#next_button_deathEvent')
.hostNodes()
.simulate('click')

component
.find('#submit_form')
.hostNodes()
Expand Down
Loading

0 comments on commit 95ce46b

Please sign in to comment.