[ 
https://issues.apache.org/jira/browse/FLAGON-441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16904317#comment-16904317
 ] 

Joshua Poore commented on FLAGON-441:
-------------------------------------

[~rf] have any thoughts on this??

Basically, with this simple add into the settings.sessionId var in 
getInitialSettings, now JSDOM tests cant read properties of the userale object: 
window.userale.options & window.userale.options.

I tried running tests after importing jsdom-global, which resolved a similar 
error at the DOM level (e.g., jsdom couldn't see "window" at one point, because 
it emulates the document).

I also tried pulling the function out of settings.sessionID declaration, 
declaring a var with the function externally, and passing that variable back 
into settings.sessionID. same issue.

However, when I moved the previous declaration "session_" + date.now() to a 
var, and passed that variable to settings, unit tests ran very well. 

perhaps userale object hasn't fully loaded?

Any insights would be helpful. Curious to know if we have to fix my code or the 
unit tests.

> utilize sessionStorage for sessionId so that sessionId isn't cleared until 
> the tab is closed.
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLAGON-441
>                 URL: https://issues.apache.org/jira/browse/FLAGON-441
>             Project: Flagon
>          Issue Type: Sub-task
>          Components: UserALE.js
>    Affects Versions: UserALE.js 2.1.0
>            Reporter: Joshua Poore
>            Assignee: Joshua Poore
>            Priority: Major
>             Fix For: UserALE.js 2.1.0
>
>
> we can build sessionId the same way as we do, but it needs to be passed to, 
> checked for, and ingested from sessionId to keep sessionId from regenerating 
> on refresh (incl. submit).



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to