Skip to content

Commit

Permalink
correction des tests avec la nouvelle année (#1583)
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz authored Jan 5, 2025
1 parent 33880df commit d17fcd1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
17 changes: 17 additions & 0 deletions db/seeds/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public function run()
$oneMonthInSeconds = 60*60*24*30;

$dateDebutUserExpire = mktime(17, 32, 15, 7, 13,2018);
$year = date('Y');

$data = [
[
Expand Down Expand Up @@ -221,6 +222,14 @@ public function run()
'date_fin' => mktime(16, 10, 10, 1, 1, 2025),
'numero_facture' => 'COTIS-2024-245',
],
[
'date_debut' => mktime(16, 10, 10, 1, 1, $year),
'type_personne' => AFUP_PERSONNES_PHYSIQUES,
'id_personne' => self::ID_USER_PERSONNE_PHYSIQUE_FIXED_COTISATIONS,
'montant' => 30,
'date_fin' => mktime(16, 10, 10, 1, 1, $year+1),
'numero_facture' => "COTIS-$year-245",
],
[
'date_debut' => mktime(16, 10, 10, 1, 2, 2023),
'type_personne' => AFUP_PERSONNES_MORALES,
Expand All @@ -237,6 +246,14 @@ public function run()
'date_fin' => mktime(16, 10, 10, 1, 2, 2025),
'numero_facture' => 'COTIS-2024-249',
],
[
'date_debut' => mktime(16, 10, 10, 1, 2, $year),
'type_personne' => AFUP_PERSONNES_MORALES,
'id_personne' => self::ID_PERSONNE_MORALE_HELIOS_AEROSPACE,
'montant' => 180,
'date_fin' => mktime(16, 10, 10, 1, 2, $year+1),
'numero_facture' => "COTIS-$year-249",
],
];

$table = $this->table('afup_cotisations');
Expand Down
6 changes: 3 additions & 3 deletions tests/behat/features/Admin/Tresorerie/DevisFactures.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 2024-3 par mail"
Then I follow the button of tooltip "Envoyer la facture 2025-3 par mail"
And I should only receive the following emails:
| from | to | subject |
| <bonjour@afup.org> | <martine@ens-en-folie.biz> | Facture AFUP |
Expand All @@ -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 2024-3"
And I follow the button of tooltip "Télécharger la facture 2025-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"
Expand Down Expand Up @@ -158,7 +158,7 @@ Feature: Administration - Trésorerie - Devis/Facture
@vat
Scenario: Test du PDF de facture après 2024
Given I am logged in as admin and on the Administration
When I go to "/pages/administration/index.php?page=compta_devis"
When I go to "/pages/administration/index.php?page=compta_devis&id_periode=15"
Then the ".content h2" element should contain "Liste devis"
When I follow the button of tooltip "Télécharger le devis Krampouz"
Then the response header "Content-disposition" should equal 'attachment; filename="Devis - Krampouz - 2024-01-03.pdf"'
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/MembersArea/Index.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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-2024-200_13072018.pdf"'
Then the response header "Content-disposition" should equal 'attachment; filename="MyCorp_COTIS-2025-200_13072018.pdf"'

@reloadDbWithTestData
Scenario: Si on est pas company manager de la personne morale, on ne peux pas télécharger la facture
Expand Down

0 comments on commit d17fcd1

Please sign in to comment.