From 2bfd76c6a0c5558d6ed6b6a088ed637974d4185e Mon Sep 17 00:00:00 2001 From: Dave MacFarlane Date: Wed, 8 Apr 2020 11:45:58 -0400 Subject: [PATCH 1/2] [candidate_profile] Add test plan for module Add a test plan for new `candidate_profile` module to test the functionality provided by the module itself. --- modules/candidate_profile/test/TestPlan.md | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/candidate_profile/test/TestPlan.md diff --git a/modules/candidate_profile/test/TestPlan.md b/modules/candidate_profile/test/TestPlan.md new file mode 100644 index 00000000000..6e8511d8c7e --- /dev/null +++ b/modules/candidate_profile/test/TestPlan.md @@ -0,0 +1,55 @@ +# Candidate Profile Test Plan + +## Module / Page Permissions +1. Access the module at the url `$LORISURL/candidate_profile/$CandID` for + a CandID that the logged in user has access to. The page should load + with (at a minimum) a "Candidate Info" card. Ensure that the links + in the "Visits" work. +2. Access the module the same URL while logged out. Ensure there is a permission + denied page with an appropriate HTTP response code and no cards are + displayed. +3. Log back in, and access a URL for a candidate that the user should + not have access to (wrong project, site, etc). Ensure that there is + a permission denied page. +4. Access a CandID that does not exist. Ensure that there is a 404 + Not Found response. + +## Widget Permissions +For a module that adds a widget and a candidate which has data for +that widget (ie. the media module for CandID 491446 in Raisinbread): +1. Ensure that the card appears when accessing that candidate as a + user who has appropriate permission and access to the module + itself. +2. Ensure that the card does *not* appear (but other cards do) when + the user does not have appropriate permissions to access the + module. +3. Disable the module in LORIS, ensure that the card does not appear + even if the user has permissions (but other cards still do) + +## Candidate Info Widget + +1. Ensure that the "Candidate Info" card displays correct data for data + returned by API: + - PSCID + - DCCID + - Date of Birth + - Age + - Sex + - Project + - Subproject + - Site + - Visits +2. Ensure that any visits under "Visits" are links that go to the + candidate's visit. +3. Ensure that other modules are able to add extra terms to the candidate + info by implementing a `getWidgets` function which returns an array of + `\LORIS\candidate_profile\CandidateInfo` objects when the type is + 'candidateinfo', either by implementing the function on a module or + testing a module which already has it implemented (such as + `candidate_parameters`) +4. Ensure that, when the module which added the extra `CandidateInfo` terms + is disabled, the terms from that module no longer show up in the + `Candidate Info` card. + +All other widgets are part of other modules, and should be tested as +part of that module's testing. From b5f1ce966b8eea0432e52bafbf0293ef7eb4f92d Mon Sep 17 00:00:00 2001 From: Dave MacFarlane Date: Thu, 23 Apr 2020 14:06:31 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-Authored-By: PapillonMcGill <34311645+PapillonMcGill@users.noreply.github.com> --- modules/candidate_profile/test/TestPlan.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/candidate_profile/test/TestPlan.md b/modules/candidate_profile/test/TestPlan.md index 6e8511d8c7e..d782b97c8d6 100644 --- a/modules/candidate_profile/test/TestPlan.md +++ b/modules/candidate_profile/test/TestPlan.md @@ -5,7 +5,7 @@ a CandID that the logged in user has access to. The page should load with (at a minimum) a "Candidate Info" card. Ensure that the links in the "Visits" work. -2. Access the module the same URL while logged out. Ensure there is a permission +2. Access the module the using same URL while logged out. Ensure there is a permission denied page with an appropriate HTTP response code and no cards are displayed. 3. Log back in, and access a URL for a candidate that the user should @@ -24,7 +24,7 @@ that widget (ie. the media module for CandID 491446 in Raisinbread): the user does not have appropriate permissions to access the module. 3. Disable the module in LORIS, ensure that the card does not appear - even if the user has permissions (but other cards still do) + even if the user has permissions (but other cards still do). ## Candidate Info Widget