-
Notifications
You must be signed in to change notification settings - Fork 839
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
test: fix validateDOMNesting warning #7508
Conversation
PASS src/components/table/table_footer_cell.test.tsx ● Console console.warn src/components/table/table_footer_cell.test.tsx:24 Warning: validateDOMNesting(...): <td> cannot appear as a child of <div>. at td at EuiTableFooterCell (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_footer_cell.tsx:29:3) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_footer.test.tsx ● Console console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): Text nodes cannot appear as a child of <tr>. at tr at tfoot at EuiTableFooter (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_footer.tsx:14:8) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <tfoot> cannot appear as a child of <div>. at tfoot at EuiTableFooter (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_footer.tsx:14:8) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_header.test.tsx ● Console console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <thead> cannot appear as a child of <div>. at thead at EuiTableHeader (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_header.tsx:26:3) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_header_cell_checkbox.test.tsx ● Console console.warn src/components/table/table_header_cell_checkbox.test.tsx:22 Warning: validateDOMNesting(...): <th> cannot appear as a child of <div>. at th at EuiTableHeaderCellCheckbox (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_header_cell_checkbox.tsx:30:8) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_header_cell.test.tsx ● Console console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <th> cannot appear as a child of <div>. at th at EuiTableHeaderCell (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_header_cell.tsx:114:3) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <td> cannot appear as a child of <div>. at td at EuiTableHeaderCell (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_header_cell.tsx:114:3) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_row_cell_checkbox.test.tsx ● Console console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <td> cannot appear as a child of <div>. at td at EuiTableRowCellCheckbox (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_row_cell_checkbox.tsx:15:8) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_row_cell.test.tsx ● Console console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <td> cannot appear as a child of <div>. at td at EuiTableRowCell (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_row_cell.tsx:117:3) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
PASS src/components/table/table_row.test.tsx ● Console console.warn scripts/jest/setup/throw_on_console_error.js:49 Warning: validateDOMNesting(...): <tr> cannot appear as a child of <div>. at tr at EuiTableRow (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/table/table_row.tsx:52:3) at /home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:62:23 at CurrentEuiBreakpointProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/breakpoint/current_breakpoint.tsx:39:8) at EuiComponentDefaultsProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/component_defaults/component_defaults.tsx:59:8) at ThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/node_modules/@emotion/react/dist/emotion-element-48d2c2e4.cjs.dev.js:125:32) at EuiEmotionThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/emotion.tsx:25:8) at EuiThemeProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/services/theme/provider.tsx:62:3) at EuiCacheProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/cache/cache_provider.tsx:18:3) at EuiProviderNestedCheck (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/nested/nested_context.tsx:20:42) at EuiProvider (/home/jun/Desktop/github/waiting-for-pr/eui/src/components/provider/provider.tsx:87:3) Signed-off-by: Eng Zer Jun <[email protected]>
👋 Since this is a community submitted pull request, a Buildkite build has not been started automatically. Would an Elastic organization member please verify the contents of this pull request and kick off a build manually? |
+ slightly clearer function names
- instead of warnings
buildkite test this |
Preview staging links for this PR:
|
💚 Build Succeeded
History
|
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.
Thank you so much for this PR, @Juneezee!! You're awesome! 🎉 ❤️🔥
Summary
Fixes #6979.
Table elements (
<thead>
,<tfoot>
,<tr>
,<td>
, etc.) have their own set of permitted parents. This PR updates the Jest unit tests for table components to fix thevalidateDOMNesting
warnings.QA
General checklist