From 17bccdea2c737abae8a4e897069ca0363922b1b0 Mon Sep 17 00:00:00 2001
From: Stakovicz <83301974+stakovicz@users.noreply.github.com>
Date: Tue, 2 Jan 2024 08:24:44 +0100
Subject: [PATCH] =?UTF-8?q?Corrige=20les=20tests=20=C3=A0=20cause=20du=20c?=
=?UTF-8?q?hangement=20d'ann=C3=A9e=20(#1409)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/seeds/Compta.php | 13 +++++++------
features/bootstrap/FeatureContext.php | 2 +-
htdocs/templates/administration/compta_devis.html | 2 +-
.../Admin/Tresorerie/BalanceComptable.feature | 4 ++--
tests/behat/features/Admin/Tresorerie/Bilan.feature | 4 ++--
.../features/Admin/Tresorerie/CompteBanques.feature | 4 ++--
.../features/Admin/Tresorerie/DevisFactures.feature | 6 +++---
tests/behat/features/MembersArea/Index.feature | 2 +-
8 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/db/seeds/Compta.php b/db/seeds/Compta.php
index 0cf37662f..5c39a452f 100644
--- a/db/seeds/Compta.php
+++ b/db/seeds/Compta.php
@@ -6,7 +6,8 @@ class Compta extends AbstractSeed
{
public function run()
{
- $dir = 'htdocs/uploads/202310/';
+ $path = date('Y10').'/';
+ $dir = 'htdocs/uploads/'.$path;
if (!is_dir($dir)) {
if (!mkdir($dir) && !is_dir($dir)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $dir));
@@ -23,10 +24,10 @@ public function run()
'tva_intra' => 'FR5512345',
'montant' => 1000,
'idmode_regl' => 2,
- 'date_regl' => '2023-10-16',
- 'date_ecriture' => '2023-10-17',
+ 'date_regl' => date('Y-10-16'),
+ 'date_ecriture' => date('Y-10-17'),
'description' => 'Une recette qui rapporte',
- 'attachment_filename' => '202310/test_file1.pdf',
+ 'attachment_filename' => $path.'/test_file1.pdf',
'idevenement' => 5,
'idcompte' => 1
],
@@ -37,8 +38,8 @@ public function run()
'tva_intra' => 'FR9912345',
'montant' => 500,
'idmode_regl' => 2,
- 'date_regl' => '2023-10-17',
- 'date_ecriture' => '2023-10-18',
+ 'date_regl' => date('Y-10-17'),
+ 'date_ecriture' => date('Y-10-18'),
'description' => 'Une dépense très utile',
'idevenement' => 5,
'idcompte' => 1
diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php
index 99d9271e5..91952765f 100644
--- a/features/bootstrap/FeatureContext.php
+++ b/features/bootstrap/FeatureContext.php
@@ -374,7 +374,7 @@ public function checksumOfTheResponseContentShouldBe($expectedChecksum)
}
/**
- * @Then print last reponse headers
+ * @Then print last response headers
*/
public function printLastResponseHeaders()
{
diff --git a/htdocs/templates/administration/compta_devis.html b/htdocs/templates/administration/compta_devis.html
index e986eeead..964832be1 100644
--- a/htdocs/templates/administration/compta_devis.html
+++ b/htdocs/templates/administration/compta_devis.html
@@ -81,7 +81,7 @@
Liste devis
{/if}
diff --git a/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature b/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature
index 2bba9b9e7..3109ab415 100644
--- a/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature
+++ b/tests/behat/features/Admin/Tresorerie/BalanceComptable.feature
@@ -7,5 +7,5 @@ Feature: Administration - Trésorerie - Balance comptable
Then the ".content h2" element should contain "Balance comptable"
And I should see "AG 500,00 1 000,00"
And I follow the button of tooltip "Voir sur la page courante"
- And I should see "17/10/2023 Assurances Une recette qui rapporte 0,00 1 000,00"
- And I should see "18/10/2023 Assurances Une dépense très utile 500,00 0,00"
+ And I should see "Assurances Une recette qui rapporte 0,00 1 000,00"
+ And I should see "Assurances Une dépense très utile 500,00 0,00"
diff --git a/tests/behat/features/Admin/Tresorerie/Bilan.feature b/tests/behat/features/Admin/Tresorerie/Bilan.feature
index 09f5cc2e5..c53d84328 100644
--- a/tests/behat/features/Admin/Tresorerie/Bilan.feature
+++ b/tests/behat/features/Admin/Tresorerie/Bilan.feature
@@ -8,5 +8,5 @@ Feature: Administration - Trésorerie - Bilan
And I should see "AG 500,00"
And I should see "AG 1 000,00"
And I follow the button of tooltip "Déplier les écritures de débit/crédit pour AG"
- And I should see "18/10/2023 Une dépense très utile 500,00"
- And I should see "17/10/2023 Une recette qui rapporte 1 000,00"
+ And I should see "Une dépense très utile 500,00"
+ And I should see "Une recette qui rapporte 1 000,00"
diff --git a/tests/behat/features/Admin/Tresorerie/CompteBanques.feature b/tests/behat/features/Admin/Tresorerie/CompteBanques.feature
index f52f78618..a93f5c08b 100644
--- a/tests/behat/features/Admin/Tresorerie/CompteBanques.feature
+++ b/tests/behat/features/Admin/Tresorerie/CompteBanques.feature
@@ -5,8 +5,8 @@ Feature: Administration - Trésorerie - Compte banques
Given I am logged in as admin and on the Administration
When I follow "Compte banques"
Then the ".content h2" element should contain "Journal de banque"
- Then I should see "16/10/2023 Carte Bleue Une recette qui rapporte 1 000,00"
- Then I should see "17/10/2023 Carte Bleue Une dépense très utile 500,00"
+ Then I should see "Carte Bleue Une recette qui rapporte 1 000,00"
+ Then I should see "Carte Bleue Une dépense très utile 500,00"
Then I should see "500,00 Total débit"
Then I should see "1 000,00 Total crédit"
Then I should see "500,00 solde"
diff --git a/tests/behat/features/Admin/Tresorerie/DevisFactures.feature b/tests/behat/features/Admin/Tresorerie/DevisFactures.feature
index fffbb900f..f75f24643 100644
--- a/tests/behat/features/Admin/Tresorerie/DevisFactures.feature
+++ b/tests/behat/features/Admin/Tresorerie/DevisFactures.feature
@@ -46,7 +46,7 @@ Feature: Administration - Trésorerie - Devis/Facture
And I should see "CLIENT-AFGD5S"
And I should see "19 920,00"
# Téléchargement du devis
- And I follow the button of tooltip "Télécharger le devis"
+ And I follow the button of tooltip "Télécharger le devis ESN dev en folie"
Then the response header "Content-disposition" should match '#attachment; filename="Devis - ESN dev en folie - (.*).pdf"#'
When I parse the pdf downloaded content
Then The page "1" of the PDF should contain "ESN dev en folie"
@@ -68,7 +68,7 @@ Feature: Administration - Trésorerie - Devis/Facture
And I should see "Paris Cedex 7"
And I should see "Payé"
# Envoi de la facture par email
- Then I follow the button of tooltip "Envoyer la facture 2023-2 par mail"
+ Then I follow the button of tooltip "Envoyer la facture 2024-3 par mail"
And I should only receive the following emails:
| from | to | subject |
| | | Facture AFUP |
@@ -80,7 +80,7 @@ Feature: Administration - Trésorerie - Devis/Facture
# Téléchargement de la facture
When I go to "/admin/"
And I follow "Factures"
- And I follow the button of tooltip "Télécharger la facture 2023-2"
+ And I follow the button of tooltip "Télécharger la facture 2024-3"
Then the response header "Content-disposition" should match '#attachment; filename="Facture - ESN dev en folie - (.*).pdf"#'
When I parse the pdf downloaded content
Then The page "1" of the PDF should contain "N° TVA Intracommunautaire : FR7612345"
diff --git a/tests/behat/features/MembersArea/Index.feature b/tests/behat/features/MembersArea/Index.feature
index efc17afb2..4b67cbeaf 100644
--- a/tests/behat/features/MembersArea/Index.feature
+++ b/tests/behat/features/MembersArea/Index.feature
@@ -147,7 +147,7 @@ Feature: Espace membre, accueil
When I follow "Consulter"
Then I should see "Payer ma cotisation"
When I follow "Télécharger la facture"
- Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2023-200_13072018.pdf"'
+ Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2024-200_13072018.pdf"'
@reloadDbWithTestData
Scenario: Si on est pas company manager de la personne morale, on ne peux pas télécharger la facture