chore: update props types to use PropsWithChildren

Signed-off-by: Oleg S <97077423+RobotSail@users.noreply.github.com>
This commit is contained in:
Oleg S
2023-08-31 16:07:55 -04:00
parent cc2efe286a
commit 13f3b3491e
25 changed files with 77 additions and 61 deletions
@@ -50,7 +50,7 @@ describe('useTemplateSchema', () => {
};
const { result } = renderHook(() => useTemplateSchema(manifest), {
wrapper: ({ children }) => (
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
<TestApiProvider
apis={[[featureFlagsApiRef, { isActive: () => false }]]}
>
@@ -117,7 +117,7 @@ describe('useTemplateSchema', () => {
};
const { result } = renderHook(() => useTemplateSchema(manifest), {
wrapper: ({ children }) => (
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
<TestApiProvider
apis={[[featureFlagsApiRef, { isActive: () => false }]]}
>
@@ -161,7 +161,7 @@ describe('useTemplateSchema', () => {
};
const { result } = renderHook(() => useTemplateSchema(manifest), {
wrapper: ({ children }) => (
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
<TestApiProvider
apis={[[featureFlagsApiRef, { isActive: () => true }]]}
>
@@ -212,7 +212,7 @@ describe('useTemplateSchema', () => {
};
const { result } = renderHook(() => useTemplateSchema(manifest), {
wrapper: ({ children }) => (
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
<TestApiProvider
apis={[[featureFlagsApiRef, { isActive: () => false }]]}
>
@@ -250,7 +250,7 @@ describe('useTemplateSchema', () => {
};
const { result } = renderHook(() => useTemplateSchema(manifest), {
wrapper: ({ children }) => (
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
<TestApiProvider
apis={[[featureFlagsApiRef, { isActive: () => false }]]}
>
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import React, { PropsWithChildren } from 'react';
import { renderHook } from '@testing-library/react-hooks';
import { TestApiProvider } from '@backstage/test-utils';
import { type ParsedTemplateSchema } from './useTemplateSchema';
@@ -39,7 +39,7 @@ describe('useTransformSchemaToProps', () => {
const { result } = renderHook(
() => useTransformSchemaToProps(step, { layouts }),
{
wrapper: ({ children }) => (
wrapper: ({ children }: PropsWithChildren<{}>) => (
<TestApiProvider apis={[]}>{children}</TestApiProvider>
),
},
@@ -24,7 +24,7 @@ describe('SecretsContext', () => {
hook: useTemplateSecrets(),
}),
{
wrapper: ({ children }) => (
wrapper: ({ children }: React.PropsWithChildren<{}>) => (
<SecretsContextProvider>{children}</SecretsContextProvider>
),
},