Uploaded image for project: 'Flagon'
  1. Flagon
  2. FLAGON-434 capture what is submitted via forms
  3. FLAGON-451

Update unit tests to accommodate session storage features

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: UserALE.js 2.1.0
    • Fix Version/s: UserALE.js 2.1.0
    • Component/s: UserALE.js
    • Labels:
      None

      Description

      session storage needs to be a known object in unit tests.

      exercising sessionStorage in getInitialSettings to preserve session Id at page refresh (such as submit) performs expectedly in testing with the example page, however breaks the following unit tests:

        1) getInitialSettings
             getInitialSettings
               fetches all settings from a script tag:
           Uncaught TypeError: Cannot read property 'options' of undefined
            at Object.done (test/getInitialSettings_spec.js:76:39)
            at /Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/jsdom/lib/jsdom.js:325:18
            at processTicksAndRejections (internal/process/task_queues.js:75:11)
      
      
        2) getInitialSettings
             getInitialSettings
               grabs user id from params:
           Uncaught TypeError: Cannot read property 'options' of undefined
            at Object.url [as done] (test/getInitialSettings_spec.js:95:39)
            at /Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/jsdom/lib/jsdom.js:325:18
            at processTicksAndRejections (internal/process/task_queues.js:75:11)
      
      
        3) Userale API
             provides configs:
           Uncaught TypeError: Cannot read property 'options' of undefined
            at Object.done (test/main_spec.js:33:37)
            at /Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/jsdom/lib/jsdom.js:325:18
            at processTicksAndRejections (internal/process/task_queues.js:75:11)
      
      
        4) Userale API
             edits configs:
           Uncaught TypeError: Cannot read property 'options' of undefined
            at Object.done (test/main_spec.js:58:37)
            at /Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/jsdom/lib/jsdom.js:325:18
            at processTicksAndRejections (internal/process/task_queues.js:75:11)
      
      
        5) Userale API
             starts + stops:
           Uncaught TypeError: Cannot read property 'options' of undefined
            at Timeout._onTimeout (test/main_spec.js:75:24)
            at listOnTimeout (internal/timers.js:531:17)
            at processTimers (internal/timers.js:475:7)
      
      
        6) Userale API
             sends custom logs:
           Uncaught TypeError: Cannot read property 'log' of undefined
            at Object.done (test/main_spec.js:93:22)
            at /Users/jpoore/Documents/Apache_Flagon/test/incubator-flagon-useralejs/node_modules/jsdom/lib/jsdom.js:325:18
            at processTicksAndRejections (internal/process/task_queues.js:75:11)

        Attachments

          Activity

            People

            • Assignee:
              poorejc@me.com Joshua Poore
              Reporter:
              rf Rob Foley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: