File tree 1 file changed +0
-34
lines changed
1 file changed +0
-34
lines changed Original file line number Diff line number Diff line change @@ -16,40 +16,6 @@ limitations under the License.
16
16
17
17
import { RenderResult , screen , waitFor } from "@testing-library/react" ;
18
18
19
- export function cleanLocalstorage ( ) : void {
20
- window . localStorage . clear ( ) ;
21
- }
22
-
23
- export function deleteIndexedDB ( dbName : string ) : Promise < void > {
24
- return new Promise < void > ( ( resolve , reject ) => {
25
- if ( ! window . indexedDB ) {
26
- resolve ( ) ;
27
- return ;
28
- }
29
-
30
- const startTime = Date . now ( ) ;
31
- console . log ( `${ startTime } : Removing indexeddb instance: ${ dbName } ` ) ;
32
- const req = window . indexedDB . deleteDatabase ( dbName ) ;
33
-
34
- req . onblocked = ( ) : void => {
35
- console . log ( `${ Date . now ( ) } : can't yet delete indexeddb ${ dbName } because it is open elsewhere` ) ;
36
- } ;
37
-
38
- req . onerror = ( ev ) : void => {
39
- reject ( new Error ( `${ Date . now ( ) } : unable to delete indexeddb ${ dbName } : ${ req . error ?. message } ` ) ) ;
40
- } ;
41
-
42
- req . onsuccess = ( ) : void => {
43
- const now = Date . now ( ) ;
44
- console . log ( `${ now } : Removed indexeddb instance: ${ dbName } in ${ now - startTime } ms` ) ;
45
- resolve ( ) ;
46
- } ;
47
- } ) . catch ( ( e ) => {
48
- console . error ( `${ Date . now ( ) } : Error removing indexeddb instance ${ dbName } : ${ e } ` ) ;
49
- throw e ;
50
- } ) ;
51
- }
52
-
53
19
// wait for loading page
54
20
export async function waitForLoadingSpinner ( ) : Promise < void > {
55
21
await screen . findByRole ( "progressbar" ) ;
You can’t perform that action at this time.
0 commit comments