Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .github/actions/install-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ runs:
using: "composite"

steps:
- name: Install Playwright browsers
run: echo "Re enable when safe"

# - name: Cache Playwright browsers
# uses: actions/cache@v4
# with:
# path: |
# ~/.cache/ms-playwright
# key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-playwright-
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-

# - name: Install Playwright browsers
# shell: bash
# run: npx playwright install chromium --with-deps
- name: Install Playwright browsers
shell: bash
run: npx playwright install chromium --with-deps
98 changes: 46 additions & 52 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,64 +7,58 @@ jobs:
run-e2e-tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: E2E tests
run: echo "Re enable when safe"
env:
LANDBOT_CONFIG_URL: ${{ secrets.LANDBOT_CONFIG_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
API_URL: ${{ secrets.API_URL }}
API_KEY: ${{ secrets.API_KEY }}
PUBLIC_NODE_ENV: ${{ secrets.PUBLIC_NODE_ENV }}
POSTGRES_HOST: localhost
POSTGRES_PORT: 5433
POSTGRES_USER: boris
POSTGRES_PASSWORD: boris
POSTGRES_DB: boris

# env:
# LANDBOT_CONFIG_URL: ${{ secrets.LANDBOT_CONFIG_URL }}
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# API_URL: ${{ secrets.API_URL }}
# API_KEY: ${{ secrets.API_KEY }}
# PUBLIC_NODE_ENV: ${{ secrets.PUBLIC_NODE_ENV }}
# POSTGRES_HOST: localhost
# POSTGRES_PORT: 5433
# POSTGRES_USER: boris
# POSTGRES_PASSWORD: boris
# POSTGRES_DB: boris
strategy:
matrix:
node-version: [20.19.0]

# strategy:
# matrix:
# node-version: [20.19.0]
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: boris-test
ports:
- 5433:5432
options: >-
--health-cmd "pg_isready -U boris-test"
--health-interval 10s
--health-timeout 5s
--health-retries 5

# services:
# postgres:
# image: postgres:16
# env:
# POSTGRES_USER: ${{ env.POSTGRES_USER }}
# POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
# POSTGRES_DB: boris-test
# ports:
# - 5433:5432
# options: >-
# --health-cmd "pg_isready -U boris-test"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5

# steps:
# - uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

# - name: Install dependencies
# uses: ./.github/actions/install-dependencies
# with:
# node-version: ${{ matrix.node-version }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
node-version: ${{ matrix.node-version }}

# - name: Setup database
# uses: ./.github/actions/setup-database
- name: Setup database
uses: ./.github/actions/setup-database

# - name: Backend e2e tests
# run: npm run test:e2e -w @boris/backend
- name: Backend e2e tests
run: npm run test:e2e -w @boris/backend

# - name: Run backend server
# uses: ./.github/actions/run-backend
- name: Run backend server
uses: ./.github/actions/run-backend

# - name: Install playwright
# uses: ./.github/actions/install-playwright
# with:
# node-version: ${{ matrix.node-version }}
- name: Install playwright
uses: ./.github/actions/install-playwright
with:
node-version: ${{ matrix.node-version }}

# - name: Frontend e2e tests
# run: npm run test:e2e -w @boris/frontend
- name: Frontend e2e tests
run: npm run test:e2e -w @boris/frontend
148 changes: 71 additions & 77 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,83 +9,77 @@ jobs:
run-lighthouse:
runs-on: ubuntu-latest

env:
LANDBOT_CONFIG_URL: ${{ secrets.LANDBOT_CONFIG_URL }}
PUBLIC_NODE_ENV: ${{ secrets.PUBLIC_NODE_ENV }}
API_URL: ${{ secrets.API_URL }}
API_KEY: ${{ secrets.API_KEY }}
POSTGRES_HOST: localhost
POSTGRES_PORT: 5433
POSTGRES_USER: boris
POSTGRES_PASSWORD: boris
POSTGRES_DB: boris

strategy:
matrix:
node-version: [20.19.0]

services:
postgres:
image: postgres:16
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: boris-test
ports:
- 5433:5432
options: >-
--health-cmd "pg_isready -U boris-test"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4

- name: Lighthouse
run: echo "Re enable when safe"

# env:
# LANDBOT_CONFIG_URL: ${{ secrets.LANDBOT_CONFIG_URL }}
# PUBLIC_NODE_ENV: ${{ secrets.PUBLIC_NODE_ENV }}
# API_URL: ${{ secrets.API_URL }}
# API_KEY: ${{ secrets.API_KEY }}
# POSTGRES_HOST: localhost
# POSTGRES_PORT: 5433
# POSTGRES_USER: boris
# POSTGRES_PASSWORD: boris
# POSTGRES_DB: boris

# strategy:
# matrix:
# node-version: [20.19.0]

# services:
# postgres:
# image: postgres:16
# env:
# POSTGRES_USER: ${{ env.POSTGRES_USER }}
# POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
# POSTGRES_DB: boris-test
# ports:
# - 5433:5432
# options: >-
# --health-cmd "pg_isready -U boris-test"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5

# steps:
# - uses: actions/checkout@v4

# - name: Install dependencies
# uses: ./.github/actions/install-dependencies
# with:
# node-version: ${{ matrix.node-version }}

# - name: Setup database
# uses: ./.github/actions/setup-database

# - name: Run backend server
# uses: ./.github/actions/run-backend

# - name: Build frontend
# run: npm run build -w @boris/frontend

# - name: Start server
# run: npm run preview -w @boris/frontend &

# - name: Run lighthouse desktop
# run: npm run lighthouse-desktop -w @boris/frontend

# - name: Upload lighthouse desktop report
# if: always()
# uses: actions/upload-artifact@v4
# with:
# include-hidden-files: true
# name: lighthouse-report-ubuntu-latest
# path: ${{ github.workspace }}/apps/frontend/.lighthouseci/*

# - name: Run lighthouse mobile
# # skip for now
# if: false
# run: npm run lighthouse-mobile -w @boris/frontend

# - name: Upload lighthouse mobile report
# # skip for now
# if: false
# uses: actions/upload-artifact@v4
# with:
# include-hidden-files: true
# name: lighthouse-report-ubuntu-latest
# path: ${{ github.workspace }}/apps/frontend/.lighthouseci/*
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
node-version: ${{ matrix.node-version }}

- name: Setup database
uses: ./.github/actions/setup-database

- name: Run backend server
uses: ./.github/actions/run-backend

- name: Build frontend
run: npm run build -w @boris/frontend

- name: Start server
run: npm run preview -w @boris/frontend &

- name: Run lighthouse desktop
run: npm run lighthouse-desktop -w @boris/frontend

- name: Upload lighthouse desktop report
if: always()
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: lighthouse-report-ubuntu-latest
path: ${{ github.workspace }}/apps/frontend/.lighthouseci/*

- name: Run lighthouse mobile
# skip for now
if: false
run: npm run lighthouse-mobile -w @boris/frontend

- name: Upload lighthouse mobile report
# skip for now
if: false
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: lighthouse-report-ubuntu-latest
path: ${{ github.workspace }}/apps/frontend/.lighthouseci/*
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { INestApplication } from '@nestjs/common';
import { ConversionFunnelResult } from 'src/domain/landbot-customer/landbot-customer.repository.interface';
import * as request from 'supertest';
import { App } from 'supertest/types';
import { setupTestingApp } from 'test/config/setup.e2e';
Expand Down Expand Up @@ -30,22 +29,19 @@ describe('GetLandbotCustomersConversionFunnelController', () => {
.set('x-api-key', process.env.API_KEY as string);

expect(status).toBe(200);
expect(body).toHaveProperty('data');

const data: ConversionFunnelResult = body.data;

expect(data).toHaveProperty('totalSimulations');
expect(data).toHaveProperty('totalHouseholdProvided');
expect(data).toHaveProperty('totalEligble');
expect(data).toHaveProperty('totalConnectionWish');
expect(data).toHaveProperty('totalEmailProvided');
expect(data).toHaveProperty('totalDesiredCityProvided');

expect(typeof data.totalSimulations).toBe('number');
expect(typeof data.totalHouseholdProvided).toBe('number');
expect(typeof data.totalEligble).toBe('number');
expect(typeof data.totalConnectionWish).toBe('number');
expect(typeof data.totalEmailProvided).toBe('number');
expect(typeof data.totalDesiredCityProvided).toBe('number');

expect(body).toHaveProperty('totalSimulations');
expect(body).toHaveProperty('totalHouseholdProvided');
expect(body).toHaveProperty('totalEligble');
expect(body).toHaveProperty('totalConnectionWish');
expect(body).toHaveProperty('totalEmailProvided');
expect(body).toHaveProperty('totalDesiredCityProvided');

expect(typeof body.totalSimulations).toBe('number');
expect(typeof body.totalHouseholdProvided).toBe('number');
expect(typeof body.totalEligble).toBe('number');
expect(typeof body.totalConnectionWish).toBe('number');
expect(typeof body.totalEmailProvided).toBe('number');
expect(typeof body.totalDesiredCityProvided).toBe('number');
});
});
4 changes: 2 additions & 2 deletions apps/frontend/src/lib/components/common/Tile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
class:fr-enlarge-link={enlarge}>
<div class="fr-tile__body">
<div class="fr-tile__content">
<h3 class="fr-tile__title">
<p class="fr-tile__title">
{#if href}
<a {href}>
{title}
</a>
{:else}
{title}
{/if}
</h3>
</p>
{#if children}
{@render children()}
{:else}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{#each eligibilityData as data}
<div
class="py-2 px-0 bg-blue-deep flex justify-center items-center gap-4 mt-6 mb-1">
<h4 class="fr-mb-0">{data.category}</h4>
<h3 class="fr-mb-0 fr-h4">{data.category}</h3>
{#if data.options.length}
<Tooltip>
<ul class="text-left !list-none !p-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
ofssAmount: PageData['ofssAmount'];
eligibility: PageData['eligibility'];
hideDisclaimer?: boolean;
householdsData: {
total: number;
brsUnawarePercentage: number;
totalsRealEstateSituation: PageData['realEstateSituation'];
};
householdsData: PageData['householdsData'];
};

const {
Expand Down
7 changes: 7 additions & 0 deletions apps/frontend/src/routes/statistiques/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
} = data;
</script>

<svelte:head>
<title>Statistiques - BoRiS</title>
<meta
name="description"
content="Voir les statistiques du Bail Réel Solidaire (BRS) sur BoRiS." />
</svelte:head>

<Section>
<h1 class="!mb-0">Statistiques</h1>

Expand Down