Skip to content

Commit

Permalink
Merge pull request #769 from Amsterdam/release/1.10.4
Browse files Browse the repository at this point in the history
Release/v1.10.4
  • Loading branch information
janjaap authored Apr 15, 2020
2 parents 334ae8b + f082d88 commit 4396035
Show file tree
Hide file tree
Showing 69 changed files with 3,338 additions and 253 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ const prettierOptions = JSON.parse(

module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['prettier', 'redux-saga', 'react', 'react-hooks', 'jsx-a11y'],
extends: ['airbnb', 'plugin:cypress/recommended', 'prettier', 'prettier/react'],
plugins: ['cypress', 'prettier', 'redux-saga', 'react', 'react-hooks', 'jsx-a11y'],
env: {
browser: true,
'cypress/globals': true,
es6: true,
jest: true,
node: true,
Expand Down
8 changes: 8 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"baseUrl": "http://localhost:3001",
"waitForAnimations": true,
"animationsDistanceTreshold": 20,
"defaultCommandTimeOut": 5000,
"requestTimeout": 15000,
"reponseTimeout": 15000
}
14 changes: 14 additions & 0 deletions cypress/fixtures/afval.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/afval"
],
[0.9232478661132222]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/schoon/sub_categories/veegzwerfvuil"
],
[0.5784865802614135]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/afwateringBrug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/civiele-constructies"
],
[0.7715446264502028]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/civiele-constructies/sub_categories/afwatering-brug"
],
[0.5018232210132977]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/bedrijvenHoreca.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-bedrijven-en-horeca"
],
[0.9229488907695368]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-bedrijven-en-horeca/sub_categories/overlast-door-bezoekers-niet-op-terras"
],
[0.5057756267653251]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/afval"
],
[0.9776825713668138]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/afval/sub_categories/container-is-kapot"
],
[0.8722236864374426]
]
}
29 changes: 29 additions & 0 deletions cypress/fixtures/createSignal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"incident_time_hours": 9,
"phone": "06-12345678",
"location": {
"address": {
"openbare_ruimte": "Sandwijk",
"huisnummer": "43",
"huisletter": "",
"huisnummer_toevoeging": "",
"postcode": "1035LA",
"woonplaats": "Amsterdam"
},
"buurt_code": "N66d",
"stadsdeel": "N",
"geometrie": {"type": "Point", "coordinates": [4.89536486, 52.42071836]}
},
"incident_time_minutes": 0,
"incident_date": "Vandaag",
"datetime": {"id": "Nu", "label": "Nu"},
"email": "[email protected]",
"description": "Voor mijn deur ligt allemaal afval op de stoep, zouden jullie ervoor kunnen zorgen dat dit wordt opgeruimd?",
"category": {
"sub_category": "http://localhost:8000/signals/v1/public/terms/categories/schoon/sub_categories/veegzwerfvuil"
},
"subcategory": "veegzwerfvuil",
"reporter": {"phone": "06-12345678", "email": "[email protected]"},
"incident_date_start": "2020-03-23T14:26:27+01:00",
"text": "Voor mijn deur ligt allemaal afval op de stoep, zouden jullie ervoor kunnen zorgen dat dit wordt opgeruimd?"
}
14 changes: 14 additions & 0 deletions cypress/fixtures/jongeren.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-van-en-door-personen-of-groepen"
],
[0.8104705377254049]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-van-en-door-personen-of-groepen/sub_categories/jongerenoverlast"
],
[0.6562979657217435]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/lantaarnpaal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/wegen-verkeer-straatmeubilair"
],
[0.9769248841480287]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/wegen-verkeer-straatmeubilair/sub_categories/lantaarnpaal-straatverlichting"
],
[0.7963426229262803]
]
}
Binary file added cypress/fixtures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions cypress/fixtures/stankoverlastBedrijf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-bedrijven-en-horeca"
],
[0.7415683754592887]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-bedrijven-en-horeca/sub_categories/stankoverlast"
],
[0.6354335539579931]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/water.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-op-het-water"
],
[0.689653354436276]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-op-het-water/sub_categories/overlast-op-het-water-snel-varen"
],
[0.7882494080437529]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/wegdek.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/wegen-verkeer-straatmeubilair"
],
[0.9194096866973556]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/wegen-verkeer-straatmeubilair/sub_categories/onderhoud-stoep-straat-en-fietspad"
],
[0.743921660215921]
]
}
14 changes: 14 additions & 0 deletions cypress/fixtures/wespen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"hoofdrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-van-dieren"
],
[0.9494929300009157]
],
"subrubriek": [
[
"https://acc.api.data.amsterdam.nl/signals/v1/public/terms/categories/overlast-van-dieren/sub_categories/wespen"
],
[0.7382120726922458]
]
}
99 changes: 99 additions & 0 deletions cypress/integration/createSignalAfval.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// <reference types="Cypress" />

import * as createSignal from '../support/commandsCreateSignal';
import { CREATE_SIGNAL } from '../support/selectorsCreateSignal';

describe('Create signal afval', () => {
before(() => {
cy.server();
cy.defineGeoSearchRoutes();
cy.getAddressRoute('1035LA 43');

// Open Homepage
cy.visitFetch('incident/beschrijf');
});

it('Should search for an address', () => {
// Check on h1
cy.checkHeaderText('Beschrijf uw melding');

// Search on address
createSignal.searchAddress('1035LA 43');
cy.wait('@getAddress');

// Select found item
createSignal.selectAddress('Sandwijk 43, 1035LA Amsterdam');
cy.wait('@lookup')
.wait('@location')
.wait('@geoSearchLocation');
});

it('Should enter a description', () => {
cy.server();
cy.route('POST', '**/signals/category/prediction', 'fixture:afval.json').as('prediction');

createSignal.inputDescription('Voor mijn deur ligt allemaal afval op de stoep, zouden jullie ervoor kunnen zorgen dat dit wordt opgeruimd?');

// Select datetime
cy.get(CREATE_SIGNAL.radioButtonTijdstipNu).click();

// Click on next
cy.clickButton('Volgende');
});

it('Should enter a phonenumber', () => {
// Check URL
cy.url().should('include', '/incident/telefoon');

// Check h1
cy.checkHeaderText('Mogen we u bellen voor vragen?');

// Fill phonenumber
cy.get(CREATE_SIGNAL.inputPhoneNumber).type('06-12345678');

// Click on next
cy.clickButton('Volgende');
});

it('Should enter an email address', () => {
// Check URL
cy.url().should('include', '/incident/email');

// Check h1
cy.checkHeaderText('Wilt u op de hoogte blijven?');

// Fill emailaddress
cy.get(CREATE_SIGNAL.inputEmail).type('[email protected]');

// Click on next
cy.clickButton('Volgende');
});

it('Should show an overview', () => {
// Check URL
cy.url().should('include', '/incident/samenvatting');

// Check h1
cy.checkHeaderText('Controleer uw gegevens');

// Check if map is visible
cy.get(CREATE_SIGNAL.mapContainer).should('be.visible');

cy.contains('Voor mijn deur ligt allemaal afval op de stoep, zouden jullie ervoor kunnen zorgen dat dit wordt opgeruimd?');
// Check mail and phonenumber
cy.contains('06-12345678').should('be.visible');
cy.contains('[email protected]').should('be.visible');

cy.clickButton('Verstuur');
});

it('Should show the last screen', () => {
// Check URL
cy.url().should('include', '/incident/bedankt');

// Check h1
cy.checkHeaderText('Bedankt!');

// TODO capture signal id
});
});
Loading

0 comments on commit 4396035

Please sign in to comment.