all files / js/ mail.deobfuscate.class.test.js

100% Statements 38/38
100% Branches 0/0
100% Functions 11/11
100% Lines 38/38
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                                                   
import MailDeobfuscate from './mail.deobfuscate.class';
 
describe('mailDeobfuscate class', () => {
  it('mailDeobfuscate is Object', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    expect(typeof mailDeobfuscate).toBe('object');
  });
 
  it('mailDeobfuscate.decodeChar is function', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    expect(typeof mailDeobfuscate.decodeChar).toBe('function');
  });
 
  it('mailDeobfuscate.decodeString is function', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    expect(typeof mailDeobfuscate.decodeString).toBe('function');
  });
 
  it(
    'decode "nopqrstuvwxyzabcdefghijklm" to "abcdefghijklmnopqrstuvwxyz"',
    () => {
      let mailDeobfuscate = new MailDeobfuscate();
      let decoded = mailDeobfuscate.decode('nopqrstuvwxyzabcdefghijklm');
      expect(decoded).toBe('abcdefghijklmnopqrstuvwxyz');
    }
  );
 
  it('decode "Simon" to "Fvzba"', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    let decoded = mailDeobfuscate.decode('Simon');
    expect(decoded).toBe('Fvzba');
  });
 
  it('decode "abc" to "nop"', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    let decoded = mailDeobfuscate.decode('abc');
    expect(decoded).toBe('nop');
  });
 
  it('decode "MAIL@example.com" to "ZNVY@rknzcyr.pbz"', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    let decoded = mailDeobfuscate.decode('MAIL@example.com');
    expect(decoded).toBe('ZNVY@rknzcyr.pbz');
  });
 
  it('decode "foo@bar.name" to "sbb@one.anzr"', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    let decoded = mailDeobfuscate.decode('foo@bar.name');
    expect(decoded).toBe('sbb@one.anzr');
  });
 
  it('decode "bar-foo@yzzy.com" to "one-sbb@lmml.pbz"', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    let decoded = mailDeobfuscate.decode('bar-foo@yzzy.com');
    expect(decoded).toBe('one-sbb@lmml.pbz');
  });
 
  it('decode "?dL$kd_ek3Ä" to "?qY$xq_rx3Ä"', () => {
    let mailDeobfuscate = new MailDeobfuscate();
    let decoded = mailDeobfuscate.decode('?dL$kd_ek3Ä');
    expect(decoded).toBe('?qY$xq_rx3Ä');
  });
});