describe("Login Flow", () => {
  it("shows login page when not authenticated", () => {
    cy.visit("/dashboard");
    // Should redirect to login
    cy.url().should("include", "/login");
  });

  it("dev login succeeds and redirects to dashboard", () => {
    cy.visit("/login");
    cy.get('input[type="email"]').type("admin@oliver.com");
    cy.get('input[type="password"]').type("devpass123");
    cy.get('button[type="submit"]').click();
    // Should redirect to dashboard after successful login
    cy.url().should("include", "/dashboard");
  });

  it("dev login fails with wrong password", () => {
    cy.visit("/login");
    cy.get('input[type="email"]').type("admin@oliver.com");
    cy.get('input[type="password"]').type("wrongpassword");
    cy.get('button[type="submit"]').click();
    // Should stay on login page
    cy.url().should("include", "/login");
  });
});
