Skip to content

Commit 1336a10

Browse files
authored
Merge pull request #107 from CodeYourFuture/filter-city-on-vulonteer-form
Filter city on vulonteer form
2 parents 8e89824 + cc9e95e commit 1336a10

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

e2e/fixtures/cities.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"cities": [
33
{
44
"_id": "123abc",
5-
"name": "London"
5+
"name": "London",
6+
"visibleIn": ["VOLUNTEER_FORM"]
67
}
78
]
89
}

e2e/integration/journey.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const mockServerURL = 'http://localhost:3001'
22

33
beforeEach(() => {
4-
cy.intercept('GET', `${mockServerURL}/cities`, { fixture: 'cities.json' })
4+
cy.intercept('GET', `${mockServerURL}/cities?visibleIn=VOLUNTEER_FORM`, {
5+
fixture: 'cities.json'
6+
})
57
cy.visit('/')
68
})
79

e2e/integration/withCode.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const mockServerURL = 'http://localhost:3001'
22

33
beforeEach(() => {
4-
cy.intercept('GET', `${mockServerURL}/cities`, { fixture: 'cities.json' })
4+
cy.intercept('GET', `${mockServerURL}/cities?visibleIn=VOLUNTEER_FORM`, {
5+
fixture: 'cities.json'
6+
})
57
})
68

79
it('shows success message', () => {

src/Redux/action/citiesActions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { domain } from '../../config'
55

66
export const getCities = async () => {
77
try {
8-
const Cities = await axios.get(`${domain()}/cities`)
8+
const Cities = await axios.get(
9+
`${domain()}/cities?visibleIn=VOLUNTEER_FORM`
10+
)
911
return Cities.data
1012
} catch (err) {
1113
return {

0 commit comments

Comments
 (0)