zxcvbn-service-test.js 722 B

12345678910111213141516171819202122232425262728
  1. /* global zxcvbn */
  2. import Ember from 'ember';
  3. import { module, test } from 'qunit';
  4. import startApp from '../helpers/start-app';
  5. var application, container, service;
  6. module('Acceptance: ZxcvbnService', {
  7. beforeEach: function() {
  8. application = startApp();
  9. container = application.__container__;
  10. service = container.lookup('service:zxcvbn');
  11. },
  12. afterEach: function() {
  13. Ember.run(application, 'destroy');
  14. }
  15. });
  16. test('loading zxcvbn and testing password with it', function(assert) {
  17. assert.expect(2);
  18. Ember.run(function() {
  19. service.loadLibrary().then(function() {
  20. assert.ok(typeof zxcvbn !== 'undefined');
  21. assert.ok(service.scorePassword('L0r3m !p5um') > 0);
  22. });
  23. });
  24. });