package dev.lions.unionflow.client.view;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

class RoleDelegationBeanTest {

  private RoleDelegationBean bean;

  @BeforeEach
  void setUp() {
    bean = new RoleDelegationBean();
  }

  @Test
  @DisplayName("getCouleurStatut — ACTIVE/REVOQUEE/EXPIREE/null/inconnu")
  void couleur() {
    assertEquals("success", bean.getCouleurStatut("ACTIVE"));
    assertEquals("danger", bean.getCouleurStatut("REVOQUEE"));
    assertEquals("warning", bean.getCouleurStatut("EXPIREE"));
    assertEquals("secondary", bean.getCouleurStatut(null));
    assertEquals("secondary", bean.getCouleurStatut("AUTRE"));
  }

  @Test
  @DisplayName("Defaults — rôle TRESORIER, dates initialisées")
  void defaults() {
    assertEquals("TRESORIER", bean.getRoleDelegue());
    assertNotNull(bean.getDateDebut());
    assertNotNull(bean.getDateFin());
  }
}
