-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug/WP-417: Onboarding User List Alternating Color (#985)
* index based styling fix for alternating user rows * WP-417: Test for multiple actions per user have correct formatting * WP-417: Test for multiple actions per user have correct formatting + prettier * WP-417: Test for multiple actions per user have correct formatting + unused import removed
- Loading branch information
Showing
3 changed files
with
156 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -19,6 +19,7 @@ function renderOnboardingAdminComponent(store) { | |
); | ||
} | ||
|
||
// Onboarding Admin component rendering | ||
describe('Onboarding Admin View', () => { | ||
it('renders onboarding steps', () => { | ||
const store = mockStore({ | ||
|
@@ -32,3 +33,148 @@ describe('Onboarding Admin View', () => { | |
expect(getByText(/username/)).toBeDefined(); | ||
}); | ||
}); | ||
|
||
// Onboarding Admin component rendering | ||
describe('Onboarding Admin View', () => { | ||
it('renders onboarding steps', () => { | ||
const store = mockStore({ | ||
onboarding: { | ||
...onboardingAdminState, | ||
admin: { | ||
// Data based off users payload output, 3 generated users that have more than 2 steps | ||
users: [ | ||
{ | ||
email: '[email protected]', | ||
firstName: 'First1', | ||
isStaff: false, | ||
lastName: 'Last1', | ||
setupComplete: false, | ||
steps: [ | ||
{ | ||
step: 'portal.apps.onboarding.steps.system_access_v3.SystemAccessStepV3', | ||
displayName: 'Allocations', | ||
description: 'Checking if allocations have been completed', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'completed', | ||
}, | ||
{ | ||
step: 'portal.apps.onboarding.steps.test_steps.MockStep', | ||
displayName: 'Checking Project Membership', | ||
description: | ||
'Checking project membership to specific project', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'staffwait', | ||
}, | ||
{ | ||
step: 'portal.apps.onboarding.steps.system_access_v3.SystemAccessStepV3', | ||
displayName: 'System Access', | ||
description: | ||
'Setting up access to TACC storage and execution systems. No action required.', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'pending', | ||
}, | ||
], | ||
username: 'User1', | ||
}, | ||
{ | ||
email: '[email protected]', | ||
firstName: 'First2', | ||
isStaff: false, | ||
lastName: 'Last2', | ||
setupComplete: false, | ||
steps: [ | ||
{ | ||
step: 'portal.apps.onboarding.steps.system_access_v3.SystemAccessStepV3', | ||
displayName: 'Allocations', | ||
description: 'Checking if allocations have been completed', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'completed', | ||
}, | ||
{ | ||
step: 'portal.apps.onboarding.steps.test_steps.MockStep', | ||
displayName: 'Checking Project Membership', | ||
description: | ||
'Checking project membership to specific project', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'staffwait', | ||
}, | ||
{ | ||
step: 'portal.apps.onboarding.steps.system_access_v3.SystemAccessStepV3', | ||
displayName: 'System Access', | ||
description: | ||
'Setting up access to TACC storage and execution systems. No action required.', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'pending', | ||
}, | ||
], | ||
username: 'User2', | ||
}, | ||
{ | ||
email: '[email protected]', | ||
firstName: 'First3', | ||
isStaff: false, | ||
lastName: 'Last3', | ||
setupComplete: false, | ||
steps: [ | ||
{ | ||
step: 'portal.apps.onboarding.steps.system_access_v3.SystemAccessStepV3', | ||
displayName: 'Allocations', | ||
description: 'Checking if allocations have been completed', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'completed', | ||
}, | ||
{ | ||
step: 'portal.apps.onboarding.steps.test_steps.MockStep', | ||
displayName: 'Checking Project Membership', | ||
description: | ||
'Checking project membership to specific project', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'staffwait', | ||
}, | ||
{ | ||
step: 'portal.apps.onboarding.steps.system_access_v3.SystemAccessStepV3', | ||
displayName: 'System Access', | ||
description: | ||
'Setting up access to TACC storage and execution systems. No action required.', | ||
userConfirm: 'Confirm', | ||
staffApprove: 'Approve', | ||
state: 'pending', | ||
}, | ||
], | ||
username: 'User3', | ||
}, | ||
], | ||
offset: 0, | ||
limit: 25, | ||
total: 3, | ||
query: '', | ||
loading: false, | ||
error: null, | ||
}, | ||
}, | ||
}); | ||
|
||
const { getByText, container } = renderOnboardingAdminComponent(store); | ||
const userElements = container.querySelectorAll('.user-row'); | ||
// Check style for user elements | ||
userElements.forEach((element, index) => { | ||
if (index % 2 === 0) { | ||
expect(element).toHaveClass('even-row'); | ||
} else { | ||
expect(element).toHaveClass('odd-row'); | ||
} | ||
}); | ||
// Check if users last and first names have been defined | ||
expect(getByText(/First1 Last1/)).toBeDefined(); | ||
expect(getByText(/First2 Last2/)).toBeDefined(); | ||
expect(getByText(/First3 Last3/)).toBeDefined(); | ||
}); | ||
}); |