@@ -5,6 +5,7 @@ import { FirebaseAppProvider, ObservableStatus, StorageProvider, useStorageDownl
55import { baseConfig } from './appConfig' ;
66import { renderHook , act as actOnHooks } from '@testing-library/react-hooks' ;
77import * as React from 'react' ;
8+ import { randomString } from './test-utils' ;
89
910describe ( 'Storage' , ( ) => {
1011 const app = initializeApp ( baseConfig ) ;
@@ -19,8 +20,9 @@ describe('Storage', () => {
1920
2021 describe ( 'useStorageTask' , ( ) => {
2122 it ( 'returns the same value as uploadTask' , async ( ) => {
22- const someBytes = Uint8Array . from ( Buffer . from ( new ArrayBuffer ( 1_000_000 ) ) ) ;
23- const testFileRef = ref ( storage , 'test-useStorageTask/testfile.txt' ) ;
23+ const someBytes = Uint8Array . from ( Buffer . from ( new ArrayBuffer ( 500_000 ) ) ) ;
24+
25+ const testFileRef = ref ( storage , `${ randomString ( ) } /${ randomString ( ) } .txt` ) ;
2426
2527 const uploadTask = uploadBytesResumable ( testFileRef , someBytes ) ;
2628
@@ -68,8 +70,8 @@ describe('Storage', () => {
6870
6971 describe ( 'useStorageDownloadURL' , ( ) => {
7072 it ( 'returns the same value as getDownloadURL' , async ( ) => {
71- const someBytes = Uint8Array . from ( Buffer . from ( new ArrayBuffer ( 1_000_000 ) ) ) ;
72- const testFileRef = ref ( storage , 'test-useStorageDownloadURL/testfile .txt' ) ;
73+ const someBytes = Uint8Array . from ( Buffer . from ( new ArrayBuffer ( 500_000 ) ) ) ;
74+ const testFileRef = ref ( storage , ` ${ randomString ( ) } / ${ randomString ( ) } .txt` ) ;
7375
7476 await uploadBytesResumable ( testFileRef , someBytes ) ;
7577
0 commit comments