New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Javascript clientState helper. Introduce Mocha+Chai JS test framework for dashboard. #4256
Conversation
*/ | ||
dashboard.clientState.EXPIRY_DAYS = 365; | ||
|
||
dashboard.clientState.reset = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there more to the client state than progress and lines? (videos seen, etc). Do we plan on resetting those? If not, then specify what's getting reset here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the module comment I had previously forgotten and made a note there about future things we'll add.
Comments are minor / more questions. Overall, LGTM. |
Responded to Mehal's comments, thanks! Added additional tests for malformed cookies. |
…into client_progress_writes
Add Javascript clientState helper. Introduce Mocha+Chai JS test framework for dashboard.
Add Javascript accessor functions for progress and lines client state. Update header.js.erb to use these helpers.
Konacha (Mocha + Chai) Test framework
Adds the Konacha test frameworks. In order include unit tests for the functions, the CL integrates the Konacha test framework (mocha + chai + Rails asset pipeline).
In brief, to run all tests interactively in your browser browser of choice:
bundle exec rake konacha:serve
then hit "http://localhost:3500" in the browser
To run dashboard JS unit tests on the command line:
bundle exec rake konacha:run
(
konacha:run
requires that you install phantomjs E.g.brew install phantomjs
on OSX)