Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/psy-file
Browse files Browse the repository at this point in the history
  • Loading branch information
desoindx committed Jan 27, 2022
2 parents bbb10ec + 9b18dbe commit 1933bec
Show file tree
Hide file tree
Showing 32 changed files with 1,788 additions and 43 deletions.
5 changes: 5 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ DB_LOGGING_ENABLE=true
DEMARCHES_SIMPLIFIEES_TOKEN=api-token
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]]

NEXT_PUBLIC_NEW_FEATURES=true

MAIL_ENABLED=false
SUPPORT_MAIL=monpsysante@fabrique.social.gouv.fr
9 changes: 8 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ DEMARCHES_SIMPLIFIEES_TOKEN=api-token
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]]

NEXT_PUBLIC_DISPLAY_DIRECTORY=false
NEXT_PUBLIC_NEW_FEATURES=false

MAIL_HOST=smtp.tipimail.com
MAIL_PORT=587
MAIL_TLS=true

MAIL_ENABLED=true
SUPPORT_MAIL=monpsysante@fabrique.social.gouv.fr
9 changes: 8 additions & 1 deletion .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ DEMARCHES_SIMPLIFIEES_TOKEN=api-token
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]]

NEXT_PUBLIC_DISPLAY_DIRECTORY=true
NEXT_PUBLIC_NEW_FEATURES=false

MAIL_HOST=smtp.tipimail.com
MAIL_PORT=587
MAIL_TLS=true

MAIL_ENABLED=true
SUPPORT_MAIL=monpsysante@fabrique.social.gouv.fr
12 changes: 12 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NEXT_TELEMETRY_DISABLED=1
DATABASE_URL=postgres://monpsysante:monpsysante@localhost:5432/monpsysante
DB_LOGGING_ENABLE=false

DEMARCHES_SIMPLIFIEES_TOKEN=api-token
DEMARCHES_SIMPLIFIEES_ID=52209
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]]

NEXT_PUBLIC_NEW_FEATURES=true

MAIL_ENABLED=false
SUPPORT_MAIL=monpsysante@fabrique.social.gouv.fr
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
- push

jobs:
Build:
runs-on: ubuntu-latest

services:
postgres:
image: postgis/postgis:14-master
env:
POSTGRES_DB: monpsysante
POSTGRES_USER: monpsysante
POSTGRES_PASSWORD: monpsysante
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: lts/*
cache: yarn

- name: Installing
run: yarn --frozen-lockfile

- name: Env file
run: cp .env.test .env

- name: Installing DB
run: npm run db:init

- name: Lint
run: npm run lint

- name: Build
run: npm run dev&

- name: Unit test
run: npm run test

- name: E2E test
run: npm run cy:run
17 changes: 17 additions & 0 deletions .socialgouv/environments/dev/app.sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
name: app-sealed-secret
namespace: app
spec:
encryptedData:
MAIL_AUTH_PASS: AgBXoippgPAY9XCDtuppex7e5C/bDqnjJnN+iTkk44+TxZxyscI/5dpUfbYzTqn+aaHvySmkXShX2KJi6dHfIi6MfnTVRP2TsSa3oxA7IWDNCbN9N0HnFFz6L3ITRHcUTO28TJBOwfPur3dN8Sw5x3WWmbvPFJEO0TF8ZrLqePD6a1/M6o95z8O/H7AWDx0QK6/61aXvUgHXj6L3RrKd+534Fns8Dn5TEPDzouUTUPNZXqih7J7k3Byq+zfBHMZD4tKc0hPTFg2TuiZUANXWkiGjHEQU5lw59chm2xpPE7SYSvTxsWGyZtupuYXP1AKvtL87ryd/mSa9SIik/ojVpRCZ6yp36u2/JaYtbBEEQmmbYugesj9BWv4t0TnwC+wrjcpkuD+MDhgIN94NMoP0Ug6Ga80NEppWqZMrj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0fq8lN3l1zr+F8GeYeUsA==
template:
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
name: app-sealed-secret
type: Opaque
17 changes: 17 additions & 0 deletions .socialgouv/environments/preprod/app.sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
name: app-sealed-secret
namespace: app
spec:
encryptedData:
MAIL_AUTH_PASS: AgBXoippgPAY9XCDtuppex7e5C/bDqnjJnN+iTkk44+TxZxyscI/5dpUfbYzTqn+aaHvySmkXShX2KJi6dHfIi6MfnTVRP2TsSa3oxA7IWDNCbN9N0HnFFz6L3ITRHcUTO28TJBOwfPur3dN8Sw5x3WWmbvPFJEO0TF8ZrLqePD6a1/M6o95z8O/H7AWDx0QK6/61aXvUgHXj6L3RrKd+534Fns8Dn5TEPDzouUTUPNZXqih7J7k3Byq+zfBHMZD4tKc0hPTFg2TuiZUANXWkiGjHEQU5lw59chm2xpPE7SYSvTxsWGyZtupuYXP1AKvtL87ryd/mSa9SIik/ojVpRCZ6yp36u2/JaYtbBEEQmmbYugesj9BWv4t0TnwC+wrjcpkuD+MDhgIN94NMoP0Ug6Ga80NEppWqZMrjlwY3hT2dQvZTVctCEkM2TF+B9TziJLI2hh8RAI/4o8myDx0QjAvHKxOLiXO19sBL3DKBaXDPPmvr8frsplUux01LqpT+HCc+UsDte+DcxfSwrvT3PLpabQaB+x0V/FBDouTOpjUcdQ3EjkzefNevcPQAKiiDD63ycSFIvd/jnaAMRQ8R7izZd1ttWkCD+XZi0RG9fmBz3AnYcfEmeZJrzjUk9DqdIS3+c44KwKl57S09MT+WqFXwr6l/UfHv+6XMXy7q3Q9sxz1bkC1j8wyqSWy2FyTMtHuKgNnH2oSjuYasyAK9goRgo4Udl5gBG25i9ziBLDonQ==
MAIL_AUTH_USER: AgDHN1LPlykEhWv0mvKhb3pDM68bymYCF65+gKiS3rV20WeNIIFZbid/nWOCqlXgKnMrAI5oXoGOVqaHH18X6WQNFbmGuAI3YR2P7OaRrUJsQN3/Q5pfoEF3H3NyMIBD2xfhDUKTVdGjcya+B3NGEJLqEly7BYadInCZVwCt6jVJrXa/bhwQmumhv/f5PucS/UzvMTKumQMkJHU5/UTiYiLDzO/gemufkfZTvVTREjXzXyeTtKPLtzTL0k5wZSU/x1/nlE4LuNT/BmxppKx4wnM+JrxCyb/bqjaqFrOzqtOy5LclnVTOe4CG8LP1HH77lolSbBPTWyiG0hn9TsoKwXY4LMOFou9WfU2AwKcgldA23wyOpIThBag30ruRIs4GlZoORiJR2Dmf4xQA2qSj/h/KyoBO/cxkGrTiXQOMcTEqTZcxeZtzcOD11IdLlHrH8y03uHGzk2VR0zBQf4EZbFG0oK3s2P4ZPW/gtSY3rNAyLh67UZdt3fihNz/iP0lnp3RqYHHzXzjGdGlyh67lE1wtPJwUgmkl5/ZGIX4Kl2qOQToaVmU789tMJ9ADaL5TP6LrJhgXolSM3Gb4K5R46Z0zxVpvCRhQa4nOKroMg1sg5LofyCSu7hs+rrE7+fJq7XYYSVA0Yy2xvnIg5bqD1fHQ9hrVifhUONBnZ0Npvlzx4DUjUYnlPZRisX7yIlPHf4TNUbyk8ZwrO2yNFuY2PgmZL0fq8lN3l1zr+F8GeYeUsA==
template:
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: 'true'
name: app-sealed-secret
type: Opaque
15 changes: 15 additions & 0 deletions .socialgouv/environments/prod/app.sealed-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations: {}
name: app-sealed-secret
namespace: app
spec:
encryptedData:
MAIL_AUTH_PASS: AgCqXteifRLzdJCR6MzXyAeRb7eGQ3TuW7lyE8JmdoqihiFPZORh2tkNI26ApHTNnd3tvPXrLZlHE7CeNL9yNRT4qIkHTj5H41Y/uOIWJtvwXJCf65iakQ7lB99KAg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RyT0AXzSYMi+MNiVYb5N8XKEF1GBi7wpI+Q4b0LJrcIStIYxslxHxLWMqQlg30Ou2kgp6O39PSC3clqWgcxe5T8H4UP+szeY8IyL8im0hiVaM2lgu2lubgkhv4kJdovWvCKXUPzSnNAbqqDpedStW2WRZ+sHaXLYl09Ef33h1CTi0u4/wJdbbF7C4qV0VHNPA1k3DF4QkRlCGS+Q29YnqIbZJd8HkF/y/5CpD4rMbtt0nRZx9xFrzEWwc0j9+L9MuGkQibfUgwBTugPrTihqvgtfqeggYZUj1HW7ZLxT22UlSw1T9UvQEPacZqXulteg==
template:
metadata:
annotations: {}
name: app-sealed-secret
type: Opaque
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [1.8.0](https://github.com/SocialGouv/mon-psy-sante/compare/v1.7.1...v1.8.0) (2022-01-27)


### Features

* **contact:** Add contact page ([#31](https://github.com/SocialGouv/mon-psy-sante/issues/31)) ([284a692](https://github.com/SocialGouv/mon-psy-sante/commit/284a692fb4aafe744abe9585fce2582326ad4fa2)), closes [#28](https://github.com/SocialGouv/mon-psy-sante/issues/28)

## [1.7.1](https://github.com/SocialGouv/mon-psy-sante/compare/v1.7.0...v1.7.1) (2022-01-26)


### Bug Fixes

* **annuaire:** hide directory for now ([#35](https://github.com/SocialGouv/mon-psy-sante/issues/35)) ([d4327e3](https://github.com/SocialGouv/mon-psy-sante/commit/d4327e328e5fea8b911b2e5c3ed55ace95886c2d))

# [1.7.0](https://github.com/SocialGouv/mon-psy-sante/compare/v1.6.0...v1.7.0) (2022-01-24)


Expand Down
5 changes: 5 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"baseUrl": "http://localhost:3000/",
"testFiles": "**/*.spec.js",
"chromeWebSecurity": false
}
118 changes: 118 additions & 0 deletions cypress/integration/contact.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
describe("Contact page", () => {
beforeEach(() => {
cy.intercept("POST", "/api/contact").as("contact");

cy.visit("/contact");
});

it("should send a mail with reason for psychologist", () => {
cy.get('[data-test-id="user-type-select"] > select > option')
.eq(1)
.then((element) =>
cy
.get('[data-test-id="user-type-select"] > select')
.select(element.val())
);
cy.get('[data-test-id="last-name-input"]')
.type('Doe');
cy.get('[data-test-id="first-name-input"]')
.type('John');
cy.get('[data-test-id="email-input"]')
.type('john.doe@msp.fr');
cy.get('[data-test-id="department-select"]')
.type('95');
cy.get('[data-test-id="reason-select"] > select > option')
.eq(2)
.then((element) =>
cy
.get('[data-test-id="reason-select"] > select')
.select(element.val())
);
cy.get('[data-test-id="message-input"]')
.type('Is this working ?');

cy.get('[data-test-id="alert"]').should('not.exist')

cy.get('[data-test-id="submit-button"]')
.click();

cy.wait("@contact")

cy.get('[data-test-id="alert"]').should('have.text', "Votre message a bien été transmis à nos équipes, nous vous répondrons dans les plus brefs délais.")
});

it("should send a mail without reason for others", () => {
cy.get('[data-test-id="user-type-select"] > select > option')
.eq(5)
.then((element) =>
cy
.get('[data-test-id="user-type-select"] > select')
.select(element.val())
);
cy.get('[data-test-id="last-name-input"]')
.type('Doe');
cy.get('[data-test-id="first-name-input"]')
.type('John');
cy.get('[data-test-id="email-input"]')
.type('john.doe@msp.fr');
cy.get('[data-test-id="department-select"]')
.type('95');
cy.get('[data-test-id="reason-select"]').should('not.exist')
cy.get('[data-test-id="message-input"]')
.type('Is this working ?');

cy.get('[data-test-id="alert"]').should('not.exist')

cy.get('[data-test-id="submit-button"]')
.click();

cy.wait("@contact")

cy.get('[data-test-id="alert"]').should('have.text', "Votre message a bien été transmis à nos équipes, nous vous répondrons dans les plus brefs délais.")
});

it("should display public info", () => {
cy.get('[data-test-id="public-info"]')
.should('not.exist')

cy.get('[data-test-id="user-type-select"] > select > option')
.eq(3)
.then((element) =>
cy
.get('[data-test-id="user-type-select"] > select')
.select(element.val())
);
cy.get('[data-test-id="public-info"]')
.should('exist')
});

it("should display psychologist info", () => {
cy.get('[data-test-id="psychologist-info"]')
.should('not.exist')

cy.get('[data-test-id="user-type-select"] > select > option')
.eq(2)
.then((element) =>
cy
.get('[data-test-id="user-type-select"] > select')
.select(element.val())
);
cy.get('[data-test-id="psychologist-info"]')
.should('exist')
});

it("should display doctor info", () => {
cy.get('[data-test-id="psychologist-info"]')
.should('not.exist')

cy.get('[data-test-id="user-type-select"] > select > option')
.eq(4)
.then((element) =>
cy
.get('[data-test-id="user-type-select"] > select')
.select(element.val())
);
cy.get('[data-test-id="psychologist-info"]')
.should('exist')
});
});
28 changes: 28 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
module.exports = on => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
// eslint-disable-next-line default-param-last
on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'chrome') {
launchOptions.args.push('--disable-dev-shm-usage');
}
return launchOptions;
});
};
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
31 changes: 31 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress.on('uncaught:exception', (err, runnable, promise) => {
// when the exception originated from an unhandled promise
// rejection, the promise is provided as a third argument
// you can turn off failing the test in this case
if (promise) {
return false;
}
// we still want to ensure there are no other unexpected
// errors, so we let them fail the test
return true;
});
Loading

0 comments on commit 1933bec

Please sign in to comment.