import { describe, expect, it } from "vitest";
import { normaliseEmail } from "./email";

describe("normaliseEmail", () => {
  it("lowercases mixed-case addresses", () => {
    expect(normaliseEmail("Craig.Williams@Example.com")).toBe(
      "craig.williams@example.com",
    );
  });

  it("trims surrounding whitespace (common from copy-paste into invite forms)", () => {
    expect(normaliseEmail("  user@example.com  ")).toBe("user@example.com");
    expect(normaliseEmail("\tuser@example.com\n")).toBe("user@example.com");
  });
});
