Skip to content

Commit

Permalink
Added a new scenario to formValidate tests with an improperly delimit…
Browse files Browse the repository at this point in the history
…ed header row
  • Loading branch information
carolyncaron committed Oct 23, 2024
1 parent c6784e4 commit 56cae6a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"Trait Name Trait Description" "Method Short Name" "Collection Method" "Unit Type"
"trait1" "trait1 description" "method1" "Collect measurements for the trait by the best method possible." "unit1" "Quantitative"
trait2 trait2 description method2 Collect measurements for the trait by the best method possible. unit2 Qualitative
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,27 @@ public function provideFilesForValidation() {
$num_form_validation_messages
];

// #2: 2nd row of file is improperly delimited
// #2: Header is improperly delimited, with proper data rows
$scenarios[] = [
$valid_genus,
'improperly_delimited_header_with_data.tsv',
[
'genus_exists' => ['status' => 'pass'],
'valid_data_file' => ['status' => 'pass'],
'valid_delimited_file' => [
'title' => 'Row is properly delimited',
'status' => 'fail',
'details' => 'Raw row is not delimited'
],
'valid_header' => ['status' => 'todo'],
'empty_cell' => ['status' => 'todo'],
'valid_data_type' => ['status' => 'todo'],
'duplicate_traits' => ['status' => 'todo']
],
$num_form_validation_messages
];

// #3: 2nd row of file is improperly delimited
$scenarios[] = [
$valid_genus,
'correct_header_improperly_delimited_data_row.tsv',
Expand All @@ -195,7 +215,7 @@ public function provideFilesForValidation() {
$num_form_validation_messages
];

// #3: Contains correct header but no data
// #4: Contains correct header but no data
// Never reaches the validators for data-row since file content is empty
$scenarios[] = [
$valid_genus,
Expand All @@ -212,7 +232,7 @@ public function provideFilesForValidation() {
$num_form_validation_messages
];

// #4: Contains incorrect header and one line of correct data
// #5: Contains incorrect header and one line of correct data
$scenarios[] = [
$valid_genus,
'incorrect_header_with_data.tsv',
Expand All @@ -232,7 +252,7 @@ public function provideFilesForValidation() {
$num_form_validation_messages
];

// #5: Contains correct header and one line of correct data,
// #6: Contains correct header and one line of correct data,
// 2nd line has an empty 'Short Method Name'
$scenarios[] = [
$valid_genus,
Expand All @@ -253,7 +273,7 @@ public function provideFilesForValidation() {
$num_form_validation_messages
];

// #6: Contains correct header and two lines of data
// #7: Contains correct header and two lines of data
// First line has an invalid value for 'Type' column
$scenarios[] = [
$valid_genus,
Expand All @@ -274,7 +294,7 @@ public function provideFilesForValidation() {
$num_form_validation_messages
];

// #7: Contains correct header and a duplicate trait-method-unit combo
// #8: Contains correct header and a duplicate trait-method-unit combo
$scenarios[] = [
$valid_genus,
'correct_header_duplicate_traitMethodUnit.tsv',
Expand Down

0 comments on commit 56cae6a

Please sign in to comment.