Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new profile] fix for single site affiliation bug #6008

Merged
merged 4 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/new_profile/jsx/NewProfileIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class NewProfileIndex extends React.Component {
required = {true}
/>;
}
if (this.state.configData['site'] !== null) {
if (this.state.configData.site && this.state.configData.site.length !== 0) {
site =
<SelectElement
name = "site"
Expand Down
2 changes: 1 addition & 1 deletion modules/new_profile/php/new_profile.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class New_Profile extends \NDB_Form
}

// Validate site entered
$psc = (int)$values['site'] ?? '';
$psc = isset($values['site']) ? (int)$values['site'] : '';
$user_list_of_sites = $user->getData('CenterIDs');
$num_sites = count($user_list_of_sites);
if ($num_sites > 1 && (empty($psc) || !$user->hasCenter($psc))) {
Expand Down
16 changes: 0 additions & 16 deletions modules/new_profile/test/TestPlan

This file was deleted.

27 changes: 27 additions & 0 deletions modules/new_profile/test/TestPlan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# New Profile Test Plan:

1. Access New Profile page and ensure that it renders.
[Automation Testing]
2. Access with useEDC on/off and ensure that the field appears/disappears
[Manual Testing]
3. Ensure that you get an error if dates don't match (both DoB and EDC)
[Automation Testing]
4. Ensure that you get an error if any field is missing.
[Manual Testing]
5. Ensure that when the logged-in user has only 1 site affiliation, no site dropdown
shows on the page.
[Manual Testing]
6. Ensure that when the logged-in user has more than 1 site affiliation, a list of
sites is displayed and that list only contains sites the logged-in user
is affiliated to.
[Manual Testing]
7. Ensure that all valid fields added creates a new candidate with
autogenerated PSCID (if PSCID generation is "sequential").
[Automation Testing]
8. Change PSCID generation configuration to "user". Ensure that you
get an error if an invalid PSCID entered (and not if a valid PSCID is entered)
[Automation Testing]
9. Change date format from 'YMd' to 'YM' in the Configuration module
and repeat steps 4 to 6 while asserting that database values being
saved are correct.
[Manual Testing]