Skip to content

Commit 700cb69

Browse files
authored
Merge pull request #906 from jembi/revert-901-remove-swipe-facilities
Revert "Remove swipe feature"
2 parents c69036e + 762c49b commit 700cb69

File tree

5 files changed

+298
-90
lines changed

5 files changed

+298
-90
lines changed

packages/components/src/components/layout/Content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const BodyContent = styled.div`
1616
`
1717
export const Container = styled.div`
1818
background-color: ${({ theme }) => theme.colors.white};
19-
position: relative;
20-
min-height: calc(100vh - 40px);
19+
position: absolute;
2120
width: 100%;
21+
height: calc(100% - 40px);
2222
`

packages/register/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"react-router-redux": "next",
5151
"react-scripts": "^3.0.1",
5252
"react-stickynode": "^2.0.1",
53+
"react-swipeable": "^4.3.0",
5354
"redux": "^4.0.1",
5455
"redux-loop": "^5.0.0",
5556
"redux-sentry-middleware": "^0.0.15",

packages/register/src/views/RegisterForm/ApplicationForm.test.tsx

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,83 @@ describe('when user has starts a new application', () => {
240240
})
241241
})
242242

243+
describe('when user swipes left from the "child" section', () => {
244+
beforeEach(async () => {
245+
app
246+
.find('#swipeable_block')
247+
.hostNodes()
248+
.simulate('touchStart', {
249+
touches: [
250+
{
251+
clientX: 150,
252+
clientY: 20
253+
}
254+
]
255+
})
256+
.simulate('touchMove', {
257+
changedTouches: [
258+
{
259+
clientX: 100,
260+
clientY: 20
261+
}
262+
]
263+
})
264+
.simulate('touchEnd', {
265+
changedTouches: [
266+
{
267+
clientX: 50,
268+
clientY: 20
269+
}
270+
]
271+
})
272+
await flushPromises()
273+
app.update()
274+
})
275+
it('changes to the mother details section', () => {
276+
expect(app.find('#form_section_title_mother').hostNodes()).toHaveLength(
277+
1
278+
)
279+
})
280+
})
281+
282+
describe('when user swipes right from the "child" section', () => {
283+
beforeEach(async () => {
284+
app
285+
.find('#swipeable_block')
286+
.hostNodes()
287+
.simulate('touchStart', {
288+
touches: [
289+
{
290+
clientX: 50,
291+
clientY: 20
292+
}
293+
]
294+
})
295+
.simulate('touchMove', {
296+
changedTouches: [
297+
{
298+
clientX: 100,
299+
clientY: 20
300+
}
301+
]
302+
})
303+
.simulate('touchEnd', {
304+
changedTouches: [
305+
{
306+
clientX: 150,
307+
clientY: 20
308+
}
309+
]
310+
})
311+
await flushPromises()
312+
app.update()
313+
})
314+
it('user still stays in the child details section', () => {
315+
expect(app.find('#form_section_title_child').hostNodes()).toHaveLength(
316+
1
317+
)
318+
})
319+
})
243320
describe('when user clicks the "mother" page', () => {
244321
beforeEach(async () => {
245322
app
@@ -254,6 +331,44 @@ describe('when user has starts a new application', () => {
254331
1
255332
)
256333
})
334+
describe('when user swipes right from the "mother" section', () => {
335+
beforeEach(async () => {
336+
app
337+
.find('#swipeable_block')
338+
.hostNodes()
339+
.simulate('touchStart', {
340+
touches: [
341+
{
342+
clientX: 50,
343+
clientY: 20
344+
}
345+
]
346+
})
347+
.simulate('touchMove', {
348+
changedTouches: [
349+
{
350+
clientX: 100,
351+
clientY: 20
352+
}
353+
]
354+
})
355+
.simulate('touchEnd', {
356+
changedTouches: [
357+
{
358+
clientX: 150,
359+
clientY: 20
360+
}
361+
]
362+
})
363+
await flushPromises()
364+
app.update()
365+
})
366+
it('changes to the child details section', () => {
367+
expect(
368+
app.find('#form_section_title_child').hostNodes()
369+
).toHaveLength(1)
370+
})
371+
})
257372
})
258373
describe('when user clicks "next" button', () => {
259374
beforeEach(async () => {

0 commit comments

Comments
 (0)