Skip to content

Commit

Permalink
Corrige les tests à cause du changement d'année (afup#1409)
Browse files Browse the repository at this point in the history
  • Loading branch information
stakovicz authored Jan 2, 2024
1 parent 1138485 commit 17bccde
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
13 changes: 7 additions & 6 deletions db/seeds/Compta.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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
],
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public function checksumOfTheResponseContentShouldBe($expectedChecksum)
}

/**
* @Then print last reponse headers
* @Then print last response headers
*/
public function printLastResponseHeaders()
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/templates/administration/compta_devis.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h2>Liste devis </h2>
{/if}
<a href="index.php?page=compta_devis&amp;action=telecharger_devis&amp;ref={$ecriture.numero_devis}"
data-position="left center"
data-tooltip="Télécharger le devis"
data-tooltip="Télécharger le devis {$ecriture.societe}"
class="compact ui icon button"
>
<i class="file pdf icon"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions tests/behat/features/Admin/Tresorerie/Bilan.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions tests/behat/features/Admin/Tresorerie/CompteBanques.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
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 @@ -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"
Expand All @@ -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 |
| <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 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"
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-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
Expand Down

0 comments on commit 17bccde

Please sign in to comment.