There were two problems, the first is that the assertion needed to be wrapped to ensure
failures were always surfaced. The second problem was TestHelpers.wrapAssertion would
call `done` twice if a test failed.
fixes#6290
* fix(password): save passwords as passwords, not text
Fixes#3799
* fix(client): Hide all visible passwords on form submit.
This builds on @TDA's work.
Before the form is submit, convert all visible passwords from
[type=text] to [type=password] so that they are not saved as
form data.
In the process, I noticed two problems that are fixed:
* The cursor was not being correctly replaced to its original position
once a password field was converted.
* If `setPasswordVisibility` was called programatically to toggle the
state of the password field, the corresponding "Show" checkbox was
not kept in sync.
fixes#3799
* chore(client): `wekbit` => `webkit`
r=@vladikoff
I have only done the `app` directory because `use strict` is forbidden
in `tests` and I do not remember why. Before converting `tests`, I want
to find out whethere `use strict` is OK to use there or not.
Screen names were only logged after their render function completed. If any
events were logged during render, those events would show up in the metrics
before the screen name, possibly causing confusion during manual metrics
analysis.
This updates to log the screen name before the render function is called.
fixes#2856
Fixes#2582
Remove the evil JSHint from our code
All hail ESLint
Fixed README.md and CONTRIBUTING.md to remove JSHint and add ESLint
Fixed camelcase errors due to removing JSHint inline
Fixes#2550
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Remove old dependencies reported by amdcheck
Remove unused variables reported by ESLint
* Add the FxDesktopRelier that imports `entrypoint` and `context` from the URL.
* Relier extended to import `service`, `redirectTo`, `client_id`, and `state`
* Initialize either the FxDesktopRelier or normal Relier on startup.
* Instead of Metrics importing values directly from the URL, they are fetched from the Relier and passed in on creation.
fixes#1568
@kparlante asked for us to add a bit of context, like a screen name, to errors so that it is easier to decide where an error originated. This led down a bit of a rabbit hole of cleaning up the error code.
* The different error types overlap in their errno's, this adds a namespace so that different errors are able to be selected from the metrics logs.
Namespaces used:
* auth-errors.js: 'auth'
* oauth-errors.js: 'oauth'
* profile-client.js: 'profile'
* The `message` field of auth-errors.js.toError was never used, so this is repuprosed to pass in a `context`.
* The format of an error event has changed to accommodate a context: 'error.<context>.<namespace>.<errno>
* When a view's `logError` function is called, the screen name is set as the error's context.
* base.js called metrics.js to fetch ids for screens and errors, then called metrics.js->logEvent. Updated to just call `logError` and `logScreen`
* A couple of TestHelper functions were added: `isScreenLogged` and `isErrorLogged`
fixes#1500
* Use SpeedTrap to collect client side metrics
* Add screen views and errors to an event stream.
* Metrics are sent to the `/metrics` endpoint on document unload or after 10 minutes of inactivity.
* Data that is sent to the backend is filtered - only data we expect is sent.
* Data collection sample rate is set by server configuration.
Other logged events:
* users who cancel login from the browser.
* complete_reset_password:link_damaged
* complete_reset_password:link_expired
* complete_signn_up:link_damaged
* confirm:too_many_attempts
* confirm:resend
* confirm_reset_password_resend
* login:canceled
Others changes:
* AuthErrors.toMessage now accepts `forceMessage`
* Change AuthErrors.toCode to accept an error object.
* Give `Session expired` an error code of 1002.
issue #1119
* URL parameter validation for `/complete_reset_password` and `/verify_email`
* Add validate.js for a central place to do validation.
* Update form to validate email addresses using validate.js
* Validate emails, tokens, and codes on the client.
* Handle errors sent by the server that says uid or code is bad.
* Handle expired tokens by giving the user an opportunity to resend the email.
* Add unit and functional tests for corner cases.
fixes#788
* Pick `service` and `redirectTo` out of the URL search parameters on startup, add it to Session.
* Add sinon.js to ensure the fxa-js-client recieves the `service` parameter when expected.
* Update the views to get `service` from Session instead of the URL.
* Add two new test suites, complete_sign_up and reset_password_complete.
* Check whether service and redirectTo make it to the complete screens.
* Check whether the expected backend calls are made when expected.
* Hook up the real translator in the tests so string interpolation can be tested.
NOTE: I updated bower to use a specific version of sinon because the official sinon.js package in bower is not set up to correctly handle amd installs and does not give spy functionality.