-
Notifications
You must be signed in to change notification settings - Fork 401
test: Fix create-linode-with-add-ons.spec.ts after Linode Interfaces GA
#13325
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
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Tests | ||
| --- | ||
|
|
||
| Fix `create-linode-with-add-ons.spec.ts` after Linode Interfaces GA ([#13325](https://github.com/linode/manager/pull/13325)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,14 @@ | ||
| import { useRegionsQuery } from '@linode/queries'; | ||
| import { Divider, Notice, Paper, Stack, Typography } from '@linode/ui'; | ||
| import React, { useMemo } from 'react'; | ||
| import { useFormContext, useWatch } from 'react-hook-form'; | ||
| import { useWatch } from 'react-hook-form'; | ||
|
|
||
| import { Backups } from './Backups'; | ||
| import { PrivateIP } from './PrivateIP'; | ||
|
|
||
| import type { CreateLinodeRequest } from '@linode/api-v4'; | ||
|
|
||
| export const Addons = () => { | ||
| const { setValue } = useFormContext<CreateLinodeRequest>(); | ||
| const [regionId, interfaceGeneration] = useWatch< | ||
| CreateLinodeRequest, | ||
| ['region', 'interface_generation'] | ||
|
|
@@ -27,11 +26,6 @@ export const Addons = () => { | |
|
|
||
| const shouldShowPrivateIP = interfaceGeneration !== 'linode'; | ||
|
|
||
| // Clean up private IP value when the option is hidden | ||
| if (!shouldShowPrivateIP) { | ||
| setValue('private_ip', false); | ||
| } | ||
|
Comment on lines
-30
to
-33
Member
Author
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. Rather then setting state during render, I moved this to the On the Linode create flow, we prefer to set state eagerly in
Contributor
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. Thanks! Double checked and confirmed that the private IP checkbox still works as expected π |
||
|
|
||
| return ( | ||
| <Paper data-qa-add-ons> | ||
| <Stack spacing={2}> | ||
|
|
||
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.
Nice!