Skip to content

Commit 805ba2f

Browse files
committed
spread rest
1 parent 212b4fc commit 805ba2f

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

packages/wizard/src/Wizard/Wizard.spec.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ describe('packages/wizard', () => {
3939
});
4040

4141
test('does not render any other elements', () => {
42-
const { container, getByText, getByTestId, getByRole, queryByTestId } =
43-
render(
44-
<Wizard>
45-
<div data-testid="invalid-element-1">This should not render</div>
46-
</Wizard>,
47-
);
42+
const { queryByTestId } = render(
43+
<Wizard>
44+
<div data-testid="invalid-element-1">This should not render</div>
45+
</Wizard>,
46+
);
4847

4948
// Non-wizard elements should not be rendered
5049
expect(queryByTestId('invalid-element-1')).not.toBeInTheDocument();

packages/wizard/src/Wizard/Wizard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function Wizard({
1616
activeStep: activeStepProp,
1717
onStepChange,
1818
children,
19+
...rest
1920
}: WizardProps) {
2021
// Controlled/Uncontrolled activeStep value
2122
const {
@@ -57,7 +58,7 @@ export function Wizard({
5758
updateStep,
5859
}}
5960
>
60-
<div className={wizardContainerStyles}>
61+
<div className={wizardContainerStyles} {...rest}>
6162
<div className={stepContentStyles}>{currentStep}</div>
6263
{footerChild}
6364
</div>

packages/wizard/src/WizardFooter/WizardFooter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const WizardFooter = ({
1212
backButtonProps,
1313
cancelButtonProps,
1414
primaryButtonProps,
15+
...rest
1516
}: WizardFooterProps) => {
1617
const { activeStep, updateStep } = useWizardContext();
1718

@@ -27,6 +28,7 @@ export const WizardFooter = ({
2728

2829
return (
2930
<FormFooter
31+
{...rest}
3032
backButtonProps={
3133
activeStep > 0
3234
? {

packages/wizard/src/WizardStep/WizardStep.types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ReactNode } from 'react';
22

3-
export interface WizardStepProps {
3+
export interface WizardStepProps
4+
extends Omit<React.ComponentProps<'div'>, 'title'> {
45
/**
56
* The title of the step
67
*/

0 commit comments

Comments
 (0)