Skip to content

Commit

Permalink
[Help editor] Test plan update (aces#6970)
Browse files Browse the repository at this point in the history
Remove references to "Last Updated" in help editor test plan.

    Resolves aces#6959
  • Loading branch information
laemtl committed Sep 10, 2020
1 parent edd3e42 commit 367eb6d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 25 deletions.
12 changes: 4 additions & 8 deletions modules/help_editor/test/TestPlan.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Help Module Test Plan
# Help Module Test Plan

1. Click on help button at the top. Contextual pull-down should appear.
[Manual Testing]
Expand All @@ -8,13 +8,11 @@
[Manual Testing]
4. Test Steps 1-3 for various pages, including instruments. All modules should take help content from their respective help.md files in their directory, while instruments’ help content is created and edited in the Edit Help section.
[Manual Testing]
5. Ensure Last update is visible at bottom and accurate.
[Manual Testing]
6. Ensure content is properly scrollable.
[Manual Testing]
7. Reopen. Click Edit button for instruments’ help content to ensure that you are taken to Edit Help section.
[Manual Testing]
8. Edit text and click Save. Click on “Return to ” the page you were viewing to ensure content was properly updated. Also Edit title and test. Click on help button and verify content was updated and 'Last updated:' is accurate.
8. Edit text and click Save. Click on “Return to ” the page you were viewing to ensure content was properly updated. Also Edit title and test. Click on help button and verify content was updated.
[Manual Testing]
9. Go back to the page editor and test "Return to " button below the text area.
[Manual Testing]
Expand All @@ -32,11 +30,9 @@
[Manual Testing]
16. Check multiple pages links.
[Manual Testing]
17. Check filter expansion.
[Manual Testing]
18. Test Reset Button - In the Help Editor, add content and click on Reset. Make sure that none of the recent changes were
17. Test Reset Button - In the Help Editor, add content and click on Reset. Make sure that none of the recent changes were
saved and the page reloads with the default content.
[Manual Testing]
19. Test Preview Button - In the Help Editor, update title and content, and click on the Preview button. Make sure
18. Test Preview Button - In the Help Editor, update title and content, and click on the Preview button. Make sure
the recent changes are visible in the Help side panel. Continue updating the content and clicking the 'Preview' button. The latest help content should show in the side panel.
[Manual Testing]
1 change: 1 addition & 0 deletions test/run-php-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ declare -a tools_list=(
'CouchDB_Import_Demographics.php'
'CouchDB_Import_Instruments.php'
'CouchDB_MRI_Importer.php'
'data_integrity/fix_candidate_age.php'
)

# And on all PHP files in this array
Expand Down
52 changes: 35 additions & 17 deletions tools/data_integrity/fix_candidate_age.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
$confirm = true;
}

$incorrectAges = array();
$nullAges = array();
$verifiedTables = array();
$incorrectAges = [];
$nullAges = [];
$verifiedTables = [];

foreach ($instruments as $inst=>$fullName) {

Expand Down Expand Up @@ -71,12 +71,16 @@

// Skip if Date taken does not exist
if (!$DB->columnExists($inst, 'Date_taken')) {
echo "\t$inst does not use a `Date_taken` field and should be handled separately.\n";
echo "\t"
. "$inst does not use a `Date_taken` field and should be handled separately."
. "\n";
continue;
}
// Skip if Date taken does not exist
if (!$DB->columnExists($inst, 'Candidate_Age')) {
echo "\t$inst does not use a `Candidate_Age` field and should be handled separately.\n";
echo "\t"
. "$inst does not use a `Candidate_Age` field "
. "and should be handled separately.\n";
continue;
}

Expand All @@ -88,13 +92,18 @@
LEFT JOIN session s ON (f.SessionID=s.ID)
LEFT JOIN candidate c ON (s.CandID=c.CandID)
WHERE c.Active='Y' AND s.Active='Y'",
array()
[]
);

foreach ($DBInstTable as $k => $row) {
// Get Instrument Instance with commentID
try {
$instrument = NDB_BVL_Instrument::factory($inst, $row['CommentID'], '', false);
$instrument = NDB_BVL_Instrument::factory(
$inst,
$row['CommentID'],
'',
false
);
} catch (Exception $e) {
echo "\t$inst instrument row with CommentID: ".$row['CommentID']." was ".
" Ignored for one of the following reasons:\n".
Expand All @@ -105,7 +114,9 @@

if (!$instrument) {
// instrument does not exist
echo "\t$inst for CommentID:$row[CommentID] could not be instantiated.\n";
echo "\t"
. "$inst for CommentID:$row[CommentID] could not be instantiated."
. "\n";
continue;
}

Expand All @@ -123,24 +134,26 @@
} else {
// get Age from instrument class
$calculatedAge = $instrument->getCandidateAge();
$calculatedAgeMonths = $instrument->calculateAgeMonths($calculatedAge);
$calculatedAgeMonths = $instrument->calculateAgeMonths(
$calculatedAge
);
//Compare age to value saved in the instrument table
$DBAge = $instrument->getFieldValue('Candidate_Age');

if ($calculatedAgeMonths != $DBAge) {
//$incorrectAges[] = $row;
$incorrectAges[$inst][$commentID] = array(
'cal' => $calculatedAgeMonths,
'db' => $DBAge,
);
$incorrectAges[$inst][$commentID] = [
'cal' => $calculatedAgeMonths,
'db' => $DBAge,
];
$trouble =true;
}
}

//Fix the saved values if confirm and trouble flags enabled
if ($trouble && $confirm) {
echo "\tFixing age for CommentID: ".$commentID."\n";
$instrument->_saveValues(array('Date_taken' => $dateTaken));
$instrument->_saveValues(['Date_taken' => $dateTaken]);
}
}
}
Expand All @@ -162,11 +175,15 @@
}

if (!$confirm) {
echo "\n\nRun this tool again with the argument 'confirm' to perform the changes\n\n";
echo "\n\n"
. "Run this tool again with the argument 'confirm' to perform the changes"
. "\n\n";
}

/*
/**
* Prints the usage and example help text and stop program
*
* @return void
*/
function showHelp()
{
Expand All @@ -179,7 +196,8 @@ function showHelp()

echo "When the 'check' option is used, the script only detects and reports
miscalculated and NULL ages.
Using the 'confirm' option will apply the necessary corrections to the data.\n\n";
Using the 'confirm' option will apply the necessary corrections to the data."
. "\n\n";

die();
}

0 comments on commit 367eb6d

Please sign in to comment.