25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

56 lines
1.3 KiB

  1. import test from 'ava';
  2. import lesspass from '../index';
  3. test('should get default template', t => {
  4. t.is('vcVCns', lesspass._getPasswordTemplate({
  5. counter: 1,
  6. length: 12,
  7. lowercase: true,
  8. uppercase: true,
  9. numbers: true,
  10. symbols: true
  11. }));
  12. });
  13. test('should get template from password setting', t => {
  14. t.is('vc', lesspass._getPasswordTemplate({
  15. lowercase: true,
  16. uppercase: false,
  17. numbers: false,
  18. symbols: false
  19. }));
  20. t.is('VC', lesspass._getPasswordTemplate({
  21. lowercase: false,
  22. uppercase: true,
  23. numbers: false,
  24. symbols: false
  25. }));
  26. t.is('n', lesspass._getPasswordTemplate({
  27. lowercase: false,
  28. uppercase: false,
  29. numbers: true,
  30. symbols: false
  31. }));
  32. t.is('s', lesspass._getPasswordTemplate({
  33. lowercase: false,
  34. uppercase: false,
  35. numbers: false,
  36. symbols: true
  37. }));
  38. });
  39. test('should concatenate template if two password settings', t => {
  40. t.is('vcVC', lesspass._getPasswordTemplate({
  41. lowercase: true,
  42. uppercase: true,
  43. numbers: false,
  44. symbols: false
  45. }));
  46. t.is('vcns', lesspass._getPasswordTemplate({
  47. lowercase: true,
  48. uppercase: false,
  49. numbers: true,
  50. symbols: true
  51. }));
  52. });