您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

64 行
2.0 KiB

  1. var assert = chai.assert;
  2. describe('LessPass', function () {
  3. describe('getPasswordTemplate', function () {
  4. it('should get default template', function () {
  5. assert.equal('vcVCns', LessPass._getPasswordTemplate({
  6. counter: 1,
  7. length: 12,
  8. lowercase: true,
  9. uppercase: true,
  10. numbers: true,
  11. symbols: true
  12. }));
  13. });
  14. it('should get lowercase template', function () {
  15. assert.equal('vc', LessPass._getPasswordTemplate({
  16. lowercase: true,
  17. uppercase: false,
  18. numbers: false,
  19. symbols: false
  20. }));
  21. });
  22. it('should get uppercase template', function () {
  23. assert.equal('VC', LessPass._getPasswordTemplate({
  24. lowercase: false,
  25. uppercase: true,
  26. numbers: false,
  27. symbols: false
  28. }));
  29. });
  30. it('should get numbers template', function () {
  31. assert.equal('n', LessPass._getPasswordTemplate({
  32. lowercase: false,
  33. uppercase: false,
  34. numbers: true,
  35. symbols: false
  36. }));
  37. });
  38. it('should get symbols template', function () {
  39. assert.equal('s', LessPass._getPasswordTemplate({
  40. lowercase: false,
  41. uppercase: false,
  42. numbers: false,
  43. symbols: true
  44. }));
  45. });
  46. it('should concatenate template if two password settings', function () {
  47. assert.equal('vcVC', LessPass._getPasswordTemplate({
  48. lowercase: true,
  49. uppercase: true,
  50. numbers: false,
  51. symbols: false
  52. }));
  53. assert.equal('vcns', LessPass._getPasswordTemplate({
  54. lowercase: true,
  55. uppercase: false,
  56. numbers: true,
  57. symbols: true
  58. }));
  59. });
  60. });
  61. });