Skip to content

Commit 48aba96

Browse files
sadpandajoeclaude
andcommitted
test(sqllab): fix tsc failure in selected-word marker test
The shared `render` helper from `@superset-ui/core/spec` omits `wrapper` from its options (it always supplies its own SupersetThemeProvider), so passing a custom `wrapper` tripped TS2353 and failed the lint-frontend tsc step. Nest the dark theme around the editor element instead; the innermost emotion ThemeProvider is what the editor's useTheme() resolves, so the assertion still exercises the dark-aware marker color. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 156aaf3 commit 48aba96

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

superset-frontend/packages/superset-ui-core/src/components/AsyncAceEditor/AsyncAceEditor.test.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import { createRef, type ReactNode } from 'react';
19+
import { createRef } from 'react';
2020
import { render, screen, waitFor } from '@superset-ui/core/spec';
2121
import {
2222
supersetTheme,
@@ -107,11 +107,14 @@ test('wires the dark-aware selected-word marker into the editor Global styles',
107107
colorEditorSelection: markerColor,
108108
};
109109

110-
const { container } = render(<SQLEditor />, {
111-
wrapper: ({ children }: { children?: ReactNode }) => (
112-
<ThemeProvider theme={darkTheme}>{children}</ThemeProvider>
113-
),
114-
});
110+
// The shared `render` helper injects its own default `SupersetThemeProvider`,
111+
// so nest the dark theme around the editor itself: the innermost emotion
112+
// `ThemeProvider` is what the editor's `useTheme()` resolves.
113+
const { container } = render(
114+
<ThemeProvider theme={darkTheme}>
115+
<SQLEditor />
116+
</ThemeProvider>,
117+
);
115118

116119
await waitFor(() => {
117120
expect(container.querySelector('[id="ace-editor"]')).toBeInTheDocument();

0 commit comments

Comments
 (0)