@@ -208,6 +208,45 @@ test('typecheck error reports diagnostics count in button and details in drawer'
208208 await expect ( page . getByText ( / T S \d + / ) ) . toBeVisible ( )
209209} )
210210
211+ test ( 'dom mode typecheck resolves @knighted/jsx type-only imports' , async ( { page } ) => {
212+ await waitForInitialRender ( page )
213+
214+ await ensurePanelToolsVisible ( page , 'component' )
215+
216+ await page . getByRole ( 'combobox' , { name : 'Render mode' } ) . selectOption ( 'dom' )
217+ await setComponentEditorSource (
218+ page ,
219+ [
220+ "import type { JsxChildren } from '@knighted/jsx'" ,
221+ '' ,
222+ 'type DrawerProps = {' ,
223+ ' children?: JsxChildren' ,
224+ '}' ,
225+ '' ,
226+ 'const Drawer = ({ children }: DrawerProps) => {' ,
227+ ' return <div className="drawer">{children}</div>' ,
228+ '}' ,
229+ '' ,
230+ 'const App = () => {' ,
231+ ' return (' ,
232+ ' <Drawer>' ,
233+ ' <p>drawer</p>' ,
234+ ' </Drawer>' ,
235+ ' )' ,
236+ '}' ,
237+ ] . join ( '\n' ) ,
238+ )
239+
240+ await runTypecheck ( page )
241+ await ensureDiagnosticsDrawerOpen ( page )
242+ await expect ( page . locator ( '#diagnostics-component' ) ) . toContainText (
243+ 'No TypeScript errors found.' ,
244+ )
245+
246+ const diagnosticsText = await page . locator ( '#diagnostics-component' ) . innerText ( )
247+ expect ( diagnosticsText ) . not . toContain ( "Cannot find module '@knighted/jsx'" )
248+ } )
249+
211250test ( 'component diagnostics rows navigate editor to reported line' , async ( { page } ) => {
212251 await waitForInitialRender ( page )
213252
0 commit comments