@@ -188,15 +188,15 @@ describe('LocalProvider', () => {
188188
189189 beforeEach ( ( ) => {
190190 localProvider = new LocalProvider ( mockCallback ) ;
191- localStorage . clear ( ) ;
191+ sessionStorage . clear ( ) ;
192192 } ) ;
193193
194194 test ( 'getDocumentList should return sorted document list' , async ( ) => {
195195 const documents = [
196196 { id : '1' , name : 'Doc 1' , create_time : '2023-01-01T00:00:00Z' } ,
197197 { id : '2' , name : 'Doc 2' , create_time : '2023-01-02T00:00:00Z' } ,
198198 ] ;
199- localStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
199+ sessionStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
200200
201201 const result = await localProvider . getDocumentList ( ) ;
202202
@@ -226,7 +226,7 @@ describe('LocalProvider', () => {
226226 await localProvider . addDocument ( id ) ;
227227
228228 const documents = JSON . parse (
229- localStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
229+ sessionStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
230230 ) ;
231231 expect ( documents ) . toHaveLength ( 1 ) ;
232232 expect ( documents [ 0 ] . id ) . toBe ( id ) ;
@@ -242,15 +242,15 @@ describe('LocalProvider', () => {
242242 content : 'Old content' ,
243243 } ,
244244 ] ;
245- localStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
245+ sessionStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
246246
247247 await localProvider . updateDocument ( '1' , {
248248 name : 'Updated Doc 1' ,
249249 content : 'New content' ,
250250 } ) ;
251251
252252 const updatedDocuments = JSON . parse (
253- localStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
253+ sessionStorage . getItem ( LOCAL_STORAGE_KEY ) || '[]' ,
254254 ) ;
255255 expect ( updatedDocuments [ 0 ] . name ) . toBe ( 'Updated Doc 1' ) ;
256256 expect ( updatedDocuments [ 0 ] . content ) . toBe ( 'New content' ) ;
@@ -260,7 +260,7 @@ describe('LocalProvider', () => {
260260 const documents = [
261261 { id : '1' , name : 'Doc 1' , create_time : '2023-01-01T00:00:00Z' } ,
262262 ] ;
263- localStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
263+ sessionStorage . setItem ( LOCAL_STORAGE_KEY , JSON . stringify ( documents ) ) ;
264264
265265 const result = await localProvider . getDocument ( '1' ) ;
266266
0 commit comments