Skip to content

Commit

Permalink
Test(web-react): Add missing Warning: prefix to expected messages
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Jan 10, 2024
1 parent 631c00e commit afb2bfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('useButtonStyleProps', () => {
const props = { color: 'primary', size: 'medium', isBlock: true, isSquare: true } as SpiritButtonProps;
renderHook(() => useButtonStyleProps(props));

expect(consoleWarnMock).toHaveBeenCalledWith('isBlock and isSquare props are mutually exclusive');
expect(consoleWarnMock).toHaveBeenCalledWith('Warning: isBlock and isSquare props are mutually exclusive');

consoleWarnMock.mockRestore();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('useButtonStyleProps', () => {
const props = { color: 'primary', size: 'medium', isBlock: true, isSquare: true } as SpiritButtonProps;
renderHook(() => useButtonLinkStyleProps(props));

expect(consoleWarnMock).toHaveBeenCalledWith('isBlock and isSquare props are mutually exclusive');
expect(consoleWarnMock).toHaveBeenCalledWith('Warning: isBlock and isSquare props are mutually exclusive');

consoleWarnMock.mockRestore();
});
Expand Down
4 changes: 2 additions & 2 deletions packages/web-react/src/hooks/__tests__/styleProps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('styleProps', () => {
renderHook(() => useStyleProps(props as StyleProps));

expect(consoleWarnMock).toHaveBeenCalledWith(
'The style prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_style if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
'Warning: The style prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_style if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
);

consoleWarnMock.mockRestore();
Expand All @@ -39,7 +39,7 @@ describe('styleProps', () => {
renderHook(() => useStyleProps(props as StyleProps));

expect(consoleWarnMock).toHaveBeenCalledWith(
'The className prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_className if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
'Warning: The className prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_className if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
);

consoleWarnMock.mockRestore();
Expand Down
4 changes: 2 additions & 2 deletions packages/web-react/tests/providerTests/stylePropsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const stylePropsTest = (Component: ComponentType<any>, testId?: string) =

await waitFor(() =>
expect(consoleWarnMock).toHaveBeenCalledWith(
'The style prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_style if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
'Warning: The style prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_style if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
),
);

Expand All @@ -47,7 +47,7 @@ export const stylePropsTest = (Component: ComponentType<any>, testId?: string) =

await waitFor(() =>
expect(consoleWarnMock).toHaveBeenCalledWith(
'The className prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_className if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
'Warning: The className prop is unsafe and is unsupported in Spirit Web React. Please use style props with Spirit Design Tokens, or UNSAFE_className if you absolutely must do something custom. Note that this may break in future versions due to DOM structure changes.',
),
);

Expand Down

0 comments on commit afb2bfc

Please sign in to comment.