mirror of https://github.com/keeweb/keeweb.git
password presenter test
This commit is contained in:
parent
c6c307c50c
commit
29329f924e
|
@ -1,3 +1,4 @@
|
|||
import 'util/kdbxweb/protected-value-ex';
|
||||
import { shuffle } from 'util/fn';
|
||||
|
||||
class RandomNameGenerator {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import kdbxweb from 'kdbxweb';
|
||||
import { expect } from 'chai';
|
||||
import { PasswordPresenter } from 'util/formatting/password-presenter';
|
||||
|
||||
describe('UrlFormat', () => {
|
||||
it('should replace passwords with dots', () => {
|
||||
expect(PasswordPresenter.present(10)).to.match(/^•{10}$/);
|
||||
});
|
||||
|
||||
it('should preserve line breaks in passwords', () => {
|
||||
const pw = kdbxweb.ProtectedValue.fromString('12\nabc\n\nd');
|
||||
expect(PasswordPresenter.presentValueWithLineBreaks(pw)).to.eql('••\n•••\n\n•');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue