@@ -188,15 +188,15 @@ describe('LocalProvider', () => {
188
188
189
189
beforeEach ( ( ) => {
190
190
localProvider = new LocalProvider ( mockCallback ) ;
191
- localStorage . clear ( ) ;
191
+ sessionStorage . clear ( ) ;
192
192
} ) ;
193
193
194
194
test ( 'getDocumentList should return sorted document list' , async ( ) => {
195
195
const documents = [
196
196
{ id : '1' , name : 'Doc 1' , create_time : '2023-01-01T00:00:00Z' } ,
197
197
{ id : '2' , name : 'Doc 2' , create_time : '2023-01-02T00:00:00Z' } ,
198
198
] ;
199
- localStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
199
+ sessionStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
200
200
201
201
const result = await localProvider . getDocumentList ( ) ;
202
202
@@ -226,7 +226,7 @@ describe('LocalProvider', () => {
226
226
await localProvider . addDocument ( id ) ;
227
227
228
228
const documents = JSON . parse (
229
- localStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
229
+ sessionStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
230
230
) ;
231
231
expect ( documents ) . toHaveLength ( 1 ) ;
232
232
expect ( documents [ 0 ] . id ) . toBe ( id ) ;
@@ -242,15 +242,15 @@ describe('LocalProvider', () => {
242
242
content : 'Old content' ,
243
243
} ,
244
244
] ;
245
- localStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
245
+ sessionStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
246
246
247
247
await localProvider . updateDocument ( '1' , {
248
248
name : 'Updated Doc 1' ,
249
249
content : 'New content' ,
250
250
} ) ;
251
251
252
252
const updatedDocuments = JSON . parse (
253
- localStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
253
+ sessionStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
254
254
) ;
255
255
expect ( updatedDocuments [ 0 ] . name ) . toBe ( 'Updated Doc 1' ) ;
256
256
expect ( updatedDocuments [ 0 ] . content ) . toBe ( 'New content' ) ;
@@ -260,7 +260,7 @@ describe('LocalProvider', () => {
260
260
const documents = [
261
261
{ id : '1' , name : 'Doc 1' , create_time : '2023-01-01T00:00:00Z' } ,
262
262
] ;
263
- localStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
263
+ sessionStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
264
264
265
265
const result = await localProvider . getDocument ( '1' ) ;
266
266
0 commit comments