Skip to content

Email Validation Test Fails for Invalid Domain #59

@carlos-alex

Description

@carlos-alex

In the Email Validation Tests using Utilities, the test case with TestId: 86 (email: [email protected]) incorrectly returns true instead of false. The domain contains an invalid character (0 in .c0m), which should fail the validation but passes as valid.

Expected:
The test should return false for an invalid domain like c0m.

Actual:
The test returns true, indicating the email is valid when it should be invalid.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

for (var testCase in testCases) {
test('TestId: ${testCase['testId']} - Testing email: ${testCase['email']}', () {
bool result = isEmailValid(testCase['email'] as String);
expect(result, testCase['expectedResult']);
});
}

final testCases = [ ...
{
'testId': 86,
'email': '[email protected]',
'expectedResult': false,
},
... ]

bool isEmailValid(String email) {
return EmailValidator.validate(email);
}

email_validator: ^3.0.0

Email Validation Tests using Utilities TestId: 86 - Testing email: [email protected] [E]
Expected:
Actual:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions