11import { describe , it , expect , vi , beforeEach , afterEach } from "vitest" ;
2- import { screen , waitFor , within , fireEvent } from "@testing-library/react" ;
2+ import { screen , waitFor , within } from "@testing-library/react" ;
33import userEvent from "@testing-library/user-event" ;
44import { render } from "@testing-library/react" ;
55import { toast } from "sonner" ;
@@ -401,7 +401,7 @@ describe("Servers", () => {
401401 } ) ;
402402
403403 vi . mocked ( api . post ) . mockResolvedValueOnce ( { } ) ;
404-
404+
405405 // api.get should be called again for refetch
406406 vi . mocked ( api . get ) . mockResolvedValueOnce ( {
407407 gateways : createMockServers ( 0 , 1 ) ,
@@ -417,7 +417,7 @@ describe("Servers", () => {
417417 await waitFor ( ( ) => {
418418 expect ( api . post ) . toHaveBeenCalledWith ( expect . stringContaining ( "activate=false" ) ) ;
419419 } ) ;
420-
420+
421421 await waitFor ( ( ) => {
422422 expect ( api . get ) . toHaveBeenCalledTimes ( 2 ) ; // Initial fetch + refetch
423423 } ) ;
@@ -447,7 +447,6 @@ describe("Servers", () => {
447447 expect ( within ( dialog ) . getByRole ( "heading" , { name : / t e s t c o n n e c t i o n / i } ) ) . toBeInTheDocument ( ) ;
448448 } ) ;
449449
450-
451450 it ( "optimistically removes server from list immediately on delete confirmation" , async ( ) => {
452451 const user = userEvent . setup ( ) ;
453452
@@ -725,12 +724,15 @@ describe("Servers", () => {
725724
726725 // Mock a slow API response for the next page
727726 let resolveSecondPage ! : ( value : any ) => void ;
728- vi . mocked ( api . get ) . mockImplementationOnce ( ( ) => new Promise ( ( resolve ) => {
729- resolveSecondPage = resolve ;
730- } ) ) ;
727+ vi . mocked ( api . get ) . mockImplementationOnce (
728+ ( ) =>
729+ new Promise ( ( resolve ) => {
730+ resolveSecondPage = resolve ;
731+ } ) ,
732+ ) ;
731733
732734 const loadMoreButton = screen . getByRole ( "button" , { name : / l o a d m o r e / i } ) ;
733-
735+
734736 // Click twice quickly
735737 await user . click ( loadMoreButton ) ;
736738 await user . click ( loadMoreButton ) ;
@@ -863,7 +865,7 @@ describe("Servers", () => {
863865
864866 // We can simulate a successful submit since the API call in MCPServerForm will use our mock
865867 vi . mocked ( api . put ) . mockResolvedValueOnce ( { } ) ;
866-
868+
867869 // Fill the required URL field (it uses URL format)
868870 const urlInput = screen . getByLabelText ( / ^ U R L / i) ;
869871 await user . clear ( urlInput ) ;
0 commit comments