@@ -392,7 +392,7 @@ test('elmish.mount sets model in localStorage', function (t) {
392
392
const root = document . getElementById ( id ) ;
393
393
elmish . mount ( 7 , update , view , id ) ;
394
394
// the "model" stored in localStorage should be 7 now:
395
- t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_store' ) ) , 7 ,
395
+ t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_' + id ) ) , 7 ,
396
396
"elmish_store is 7 (as expected). initial state saved to localStorage." ) ;
397
397
// test that mount still works as expected (check initial state of counter):
398
398
const actual = document . getElementById ( id ) . textContent ;
@@ -412,12 +412,12 @@ test('elmish.mount sets model in localStorage', function (t) {
412
412
. textContent , 10 ) ;
413
413
t . equal ( state , 8 , "State is 8 after increment." ) ;
414
414
// the "model" stored in localStorage should also be 8 now:
415
- t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_store' ) ) , 8 ,
415
+ t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_' + id ) ) , 8 ,
416
416
"elmish_store is 8 (as expected)." ) ;
417
417
elmish . empty ( root ) ; // reset the DOM to simulate refreshing a browser window
418
418
elmish . mount ( 5 , update , view , id ) ; // 5 ignored! read model from localStorage
419
419
// clearing DOM does NOT clear the localStorage (this is desired behaviour!)
420
- t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_store' ) ) , 8 ,
420
+ t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_' + id ) ) , 8 ,
421
421
"elmish_store still 8 from increment (above) saved in localStorage" ) ;
422
422
localStorage . removeItem ( 'elmish_store' ) ;
423
423
t . end ( )
@@ -451,13 +451,13 @@ test('elmish.add_attributes onclick=signal(action) events!', function (t) {
451
451
} ) ;
452
452
453
453
454
- test . skip ( 'subscriptions test using counter-reset-keyaboard ⌨️' , function ( t ) {
454
+ test . only ( 'subscriptions test using counter-reset-keyaboard ⌨️' , function ( t ) {
455
455
const { view, update } = require ( '../examples/counter-reset/counter.js' ) ;
456
456
457
457
const root = document . getElementById ( id ) ;
458
458
elmish . mount ( 0 , update , view , id ) ;
459
459
// the "model" stored in localStorage should be 7 now:
460
- t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_store' ) ) , 0 ,
460
+ t . equal ( JSON . parse ( localStorage . getItem ( 'elmish_' + id ) ) , 0 ,
461
461
"elmish_store is 0 (as expected). initial state saved to localStorage." ) ;
462
462
463
463
// trigger the [Enter] keyboard key to ADD the new todo:
0 commit comments