Skip to content
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

Merged
merged 9 commits into from Oct 1, 2015

Conversation

philbogle
Copy link
Contributor

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)

@philbogle philbogle changed the title Add clientState helper and konacha test framework and tests Add Javascript clientState helper. Introduce Mocha+Chai JS test framework for dashboard. Sep 30, 2015
*/
dashboard.clientState.EXPIRY_DAYS = 365;

dashboard.clientState.reset = function() {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@mehalshah
Copy link
Contributor

Comments are minor / more questions. Overall, LGTM.

@philbogle
Copy link
Contributor Author

Responded to Mehal's comments, thanks! Added additional tests for malformed cookies.

philbogle added a commit that referenced this pull request Oct 1, 2015
Add Javascript clientState helper.  Introduce Mocha+Chai JS test framework for dashboard.
@philbogle philbogle merged commit 40bd3b0 into staging Oct 1, 2015
@davidsbailey davidsbailey deleted the client_progress_writes branch January 7, 2016 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants