package utils

import "testing"

func TestNormalizeEmail(t *testing.T) {
	email := "arjun@flowy.live"
	normalizedEmail, err := NormalizeEmail(email)
	if err != nil {
		t.Error("invalid email parse", err)
	}

	email = " arjun@flowy.live"
	normalizedEmail, err = NormalizeEmail(email)
	if err != nil {
		t.Error("invalid email parse", err)
	}
	if normalizedEmail != "arjun@flowy.live" {
		t.Errorf("invalid email parse: %s", normalizedEmail)
	}

	email = "Arjun@flowy.live"
	normalizedEmail, err = NormalizeEmail(email)
	if err != nil {
		t.Error("invalid email parse", err)
	}
	if normalizedEmail != "arjun@flowy.live" {
		t.Errorf("invalid email parse: %s", normalizedEmail)
	}
}
