1) Add a spy within your beforeEach method.
spyOn(window.localStorage, 'getItem').and.callFake(function() {
return JSON.stringify({"test":"test"});
});
2) Test that localStorage.getItem has been called.
expect( window.localStorage.getItem ).toHaveBeenCalled();