-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Fix User Role in People Section #2459
base: develop-postgres
Are you sure you want to change the base?
Changes from 15 commits
97b380a
f19cf8b
90e6e02
2973b7a
2236632
1d8069a
a2eb1c2
9b6cf5a
c1b6e3a
f26b9e5
d9ae4d0
f7ccfb5
943eebe
a5191df
4982b1f
25beeb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,4 +222,23 @@ describe('Testing People Screen [User Portal]', () => { | |
expect(screen.queryByText('Noble Admin')).toBeInTheDocument(); | ||
expect(screen.queryByText('Noble Mittal')).not.toBeInTheDocument(); | ||
}); | ||
|
||
|
||
test('Members should be rendered with correct user type', async () => { | ||
render( | ||
<MockedProvider addTypename={false} link={link}> | ||
<BrowserRouter> | ||
<Provider store={store}> | ||
<I18nextProvider i18n={i18nForTest}> | ||
<People /> | ||
</I18nextProvider> | ||
</Provider> | ||
</BrowserRouter> | ||
</MockedProvider>, | ||
); | ||
|
||
await wait(); | ||
expect(screen.queryByText('Admin')).toBeInTheDocument(); | ||
expect(screen.queryByText('User')).toBeInTheDocument(); | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test case appears inconsistent with component behavior Based on the previous feedback and learnings, roles are not displayed in the table. However, this test assumes the presence of 'Admin' and 'User' text in the document. This might lead to:
Consider revising the test to:
Would you like me to help draft a more targeted test case once you clarify how roles are being displayed in the updated component? 🧰 Tools🪛 eslint[error] 226-227: Delete (prettier/prettier) |
||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Strengthen test assertions
The current assertions using
queryByText
are too broad and may pass even if roles appear in unintended locations.Consider:
Example structure: