-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from shystruk/dev
fields are mismatch
- Loading branch information
Showing
5 changed files
with
21 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,11 @@ const CSVInvalidFileWithDuplicates = [ | |
'Vasyl;Stokolosa;[email protected];123123123;user;Ukraine', | ||
].join('\n'); | ||
|
||
const CSVInvalidFileFieldsMismatch = [ | ||
'First Name;', | ||
'Vasyl;Stokolosa;', | ||
].join('\n'); | ||
|
||
test('module should be a function', t => { | ||
t.is(typeof CSVFileValidator, 'function'); | ||
}); | ||
|
@@ -121,3 +126,10 @@ test('file is valid and Email is not unique at the ... row', async t => { | |
t.is(csvData.inValidMessages.length, 2); | ||
t.is(csvData.data.length, 3); | ||
}); | ||
|
||
test('fields are mismatch', async t => { | ||
const csvData = await CSVFileValidator(CSVInvalidFileFieldsMismatch, { headers: [CSVConfig.headers[0]] }); | ||
|
||
t.is(csvData.inValidMessages.length, 1); | ||
t.is(csvData.data.length, 1); | ||
}); |