From feeb46844fb270d5c2c1299ff7faa88744dcd36b Mon Sep 17 00:00:00 2001 From: Tom Tang <4220945+shiba4life@users.noreply.github.com> Date: Tue, 12 May 2026 19:12:36 +0800 Subject: [PATCH] fix(query-form): wire schemasLoading to SelectField loading state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QueryForm destructured schemasLoading but never used it, tripping @typescript-eslint/no-unused-vars. SelectField already accepts config.loading and renders a spinner — pass schemasLoading through so the schema picker reflects the in-flight fetch. Also fix the now-meaningful loading test that previously asserted the combobox stayed present (it didn't — loading mode replaces it). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/server/static-react/src/components/query/QueryForm.tsx | 1 + .../src/test/components/query/QueryForm.test.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/static-react/src/components/query/QueryForm.tsx b/src/server/static-react/src/components/query/QueryForm.tsx index 7bcea1df..ace3eac4 100644 --- a/src/server/static-react/src/components/query/QueryForm.tsx +++ b/src/server/static-react/src/components/query/QueryForm.tsx @@ -87,6 +87,7 @@ function QueryForm({ value={queryState?.selectedSchema || ''} onChange={handleSchemaChange} options={buildSchemaOptions(approvedSchemas, orgNames)} + config={{ loading: schemasLoading }} /> diff --git a/src/server/static-react/src/test/components/query/QueryForm.test.tsx b/src/server/static-react/src/test/components/query/QueryForm.test.tsx index b61c875c..829061c8 100644 --- a/src/server/static-react/src/test/components/query/QueryForm.test.tsx +++ b/src/server/static-react/src/test/components/query/QueryForm.test.tsx @@ -93,8 +93,9 @@ describe('QueryForm Component', () => { mockProps.schemasLoading = true; renderWithRedux(, { preloadedState: createAuthenticatedState() }); - // The SelectField component should handle loading state - expect(screen.getByRole('combobox')).toBeInTheDocument(); + // SelectField renders a loading indicator (no combobox) while schemasLoading is true + expect(screen.getByText('Loading...')).toBeInTheDocument(); + expect(screen.queryByRole('combobox')).not.toBeInTheDocument(); }); it('should apply custom className', () => {