@@ -260,10 +260,14 @@ describe("TableCopyDropdown", () => {
260260 } ) ;
261261 // Mock ClipboardItem if not present
262262 if ( ! globalThis . ClipboardItem ) {
263- globalThis . ClipboardItem = ( ( data : Record < string , Blob > ) => ( {
264- types : Object . keys ( data ) ,
265- data,
266- } ) ) as any ;
263+ globalThis . ClipboardItem = class {
264+ types : string [ ] ;
265+ data : Record < string , Blob > ;
266+ constructor ( data : Record < string , Blob > ) {
267+ this . types = Object . keys ( data ) ;
268+ this . data = data ;
269+ }
270+ } as any ;
267271 }
268272 } ) ;
269273
@@ -297,7 +301,8 @@ describe("TableCopyDropdown", () => {
297301 ) ;
298302 expect ( mdBtn ) . toBeTruthy ( ) ;
299303
300- await act ( ( ) => {
304+ // biome-ignore lint/suspicious/useAwait: act needs async to flush clipboard promises
305+ await act ( async ( ) => {
301306 // biome-ignore lint/style/noNonNullAssertion: test assertion
302307 fireEvent . click ( mdBtn ! ) ;
303308 } ) ;
@@ -317,7 +322,8 @@ describe("TableCopyDropdown", () => {
317322 fireEvent . click ( toggleBtn ! ) ;
318323
319324 const csvBtn = container . querySelector ( 'button[title="Copy table as CSV"]' ) ;
320- await act ( ( ) => {
325+ // biome-ignore lint/suspicious/useAwait: act needs async to flush clipboard promises
326+ await act ( async ( ) => {
321327 // biome-ignore lint/style/noNonNullAssertion: test assertion
322328 fireEvent . click ( csvBtn ! ) ;
323329 } ) ;
@@ -336,7 +342,8 @@ describe("TableCopyDropdown", () => {
336342 fireEvent . click ( toggleBtn ! ) ;
337343
338344 const tsvBtn = container . querySelector ( 'button[title="Copy table as TSV"]' ) ;
339- await act ( ( ) => {
345+ // biome-ignore lint/suspicious/useAwait: act needs async to flush clipboard promises
346+ await act ( async ( ) => {
340347 // biome-ignore lint/style/noNonNullAssertion: test assertion
341348 fireEvent . click ( tsvBtn ! ) ;
342349 } ) ;
0 commit comments