Feature: Admin login
  As an operator
  I want to sign in to the admin application
  So that I can reach the metrics, monitoring and correction-triage sections

  Scenario: A wrong password shows a translated error, no redirect
    Given the admin session check returns unauthenticated
    And admin login fails with invalid credentials
    When I visit "/login"
    And I fill in the "email" field with "ops@example.com"
    And I fill in the "password" field with "wrong"
    And I click the button "Se connecter"
    Then I should see "Email ou mot de passe incorrect"
    And the URL should include "/login"

  Scenario: A correct login lands on the dashboard
    Given the admin session check returns unauthenticated
    And admin login succeeds as "Ops"
    When I visit "/login"
    And I fill in the "email" field with "ops@example.com"
    And I fill in the "password" field with "correct-horse"
    And I click the button "Se connecter"
    Then the URL should not include "/login"
    And I should see the heading "Tableau de bord"
