Skip to content

Commit 45d986b

Browse files
committed
Removed console warning
1 parent d592068 commit 45d986b

File tree

4 files changed

+0
-74
lines changed

4 files changed

+0
-74
lines changed

packages/react-core/src/components/Page/PageGroup.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ export const PageGroup = ({
4646
isNoPlainOnGlass = false,
4747
...props
4848
}: PageGroupProps) => {
49-
if (isPlain && isNoPlainOnGlass) {
50-
// eslint-disable-next-line no-console
51-
console.warn(
52-
`PageGroup: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme.`
53-
);
54-
}
55-
5649
const { height, getVerticalBreakpoint } = useContext(PageContext);
5750

5851
useEffect(() => {

packages/react-core/src/components/Page/PageSection.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ export const PageSection: React.FunctionComponent<PageSectionProps> = ({
106106
isNoPlainOnGlass = false,
107107
...props
108108
}: PageSectionProps) => {
109-
if (isPlain && isNoPlainOnGlass) {
110-
// eslint-disable-next-line no-console
111-
console.warn(
112-
`PageSection: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme.`
113-
);
114-
}
115-
116109
const { height, getVerticalBreakpoint } = useContext(PageContext);
117110

118111
useEffect(() => {

packages/react-core/src/components/Page/__tests__/PageGroup.test.tsx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,33 +101,3 @@ test(`Renders with ${styles.modifiers.noPlainOnGlass} class when isPlain is true
101101

102102
expect(screen.getByText('test')).toHaveClass(styles.modifiers.noPlainOnGlass);
103103
});
104-
105-
test('Does not log a warning when only isPlain is passed', () => {
106-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
107-
108-
render(<PageGroup isPlain>test</PageGroup>);
109-
110-
expect(consoleWarning).not.toHaveBeenCalled();
111-
});
112-
113-
test('Does not log a warning when only isNoPlainOnGlass is passed', () => {
114-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
115-
116-
render(<PageGroup isNoPlainOnGlass>test</PageGroup>);
117-
118-
expect(consoleWarning).not.toHaveBeenCalled();
119-
});
120-
121-
test('Logs a warning when both isPlain and isNoPlainOnGlass are passed', () => {
122-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
123-
124-
render(
125-
<PageGroup isPlain isNoPlainOnGlass>
126-
test
127-
</PageGroup>
128-
);
129-
130-
expect(consoleWarning).toHaveBeenCalledWith(
131-
`PageGroup: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme.`
132-
);
133-
});

packages/react-core/src/components/Page/__tests__/PageSection.test.tsx

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -199,33 +199,3 @@ test(`Renders with ${styles.modifiers.noPlainOnGlass} class when isPlain is true
199199

200200
expect(screen.getByText('test')).toHaveClass(styles.modifiers.noPlainOnGlass);
201201
});
202-
203-
test('Does not log a warning when only isPlain is passed', () => {
204-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
205-
206-
render(<PageSection isPlain>test</PageSection>);
207-
208-
expect(consoleWarning).not.toHaveBeenCalled();
209-
});
210-
211-
test('Does not log a warning when only isNoPlainOnGlass is passed', () => {
212-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
213-
214-
render(<PageSection isNoPlainOnGlass>test</PageSection>);
215-
216-
expect(consoleWarning).not.toHaveBeenCalled();
217-
});
218-
219-
test('Logs a warning when both isPlain and isNoPlainOnGlass are passed', () => {
220-
const consoleWarning = jest.spyOn(console, 'warn').mockImplementation();
221-
222-
render(
223-
<PageSection isPlain isNoPlainOnGlass>
224-
test
225-
</PageSection>
226-
);
227-
228-
expect(consoleWarning).toHaveBeenCalledWith(
229-
`PageSection: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme.`
230-
);
231-
});

0 commit comments

Comments
 (0)