-
Notifications
You must be signed in to change notification settings - Fork 358
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
test: Unit test coverage - HostNameTableCell #10596
test: Unit test coverage - HostNameTableCell #10596
Conversation
return HttpResponse.json(makeResourcePage([region])); | ||
}) | ||
); | ||
const { findByText } = renderWithThemeAndHookFormContext({ |
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.
Does HostNameTableCell
use React Hook form? If not, we can probably just use renderWithTheme
Coverage Report: ✅ |
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.
Approving pending you switch the util mentioned in the comment above
|
||
import { HostNameTableCell } from './HostNameTableCell'; | ||
|
||
const storageKeyData = { |
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.
there isn't a factory for this but it should make one cause this isn't typed at all and it could make the test code more readable
also see: https://github.com/linode/manager/blob/develop/packages/manager/src/__data__/objectStorageKeys.ts
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.
Agreed, replaced with the factory objectStorageKeyFactory
. - 26a539c
...ges/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyTable/HostNameTableCell.tsx
Outdated
Show resolved
Hide resolved
…ccessKeyTable/HostNameTableCell.tsx Co-authored-by: Alban Bailly <130582365+abailly-akamai@users.noreply.github.com>
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.
Thanks for added coverage @cpathipa!
it('should render "None" when there are no regions', () => { | ||
const { getByText } = renderWithTheme( | ||
<HostNameTableCell | ||
storageKeyData={{ |
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.
nit: you could use the factory here as well.
...ges/manager/src/features/ObjectStorage/AccessKeyLanding/AccessKeyTable/HostNameTableCell.tsx
Outdated
Show resolved
Hide resolved
…ccessKeyTable/HostNameTableCell.tsx Co-authored-by: Banks Nussman <115251059+bnussman-akamai@users.noreply.github.com>
Description 📝
This a followup of #10555 - Adds unit test coverage for HostNameTableCell.
Target release date 🗓️
6/24
How to test 🧪
Verification steps
(How to verify changes)
As an Author I have considered 🤔
Check all that apply