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

test: Unit test coverage - HostNameTableCell #10596

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

cpathipa
Copy link
Contributor

@cpathipa cpathipa commented Jun 19, 2024

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)

  • Verify unit test for HostNameTableCell.
  • Verify access key landing page is working as expected.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@cpathipa cpathipa requested a review from a team as a code owner June 19, 2024 14:17
@cpathipa cpathipa requested review from jdamore-linode and abailly-akamai and removed request for a team June 19, 2024 14:17
@cpathipa cpathipa marked this pull request as draft June 19, 2024 14:17
@cpathipa cpathipa self-assigned this Jun 19, 2024
@cpathipa cpathipa marked this pull request as ready for review June 19, 2024 14:24
return HttpResponse.json(makeResourcePage([region]));
})
);
const { findByText } = renderWithThemeAndHookFormContext({
Copy link
Member

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

Copy link

github-actions bot commented Jun 19, 2024

Coverage Report:
Base Coverage: 83.08%
Current Coverage: 83.08%

Copy link
Contributor

@jaalah-akamai jaalah-akamai left a 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 = {
Copy link
Contributor

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

Copy link
Contributor Author

@cpathipa cpathipa Jun 20, 2024

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

Copy link
Contributor

@abailly-akamai abailly-akamai left a 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={{
Copy link
Contributor

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.

…ccessKeyTable/HostNameTableCell.tsx

Co-authored-by: Banks Nussman <[email protected]>
@cpathipa cpathipa merged commit 284d3a4 into linode:develop Jun 20, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants