/* eslint-disable */

import {
  convertStringToObj,
  injectToXML,
} from '../src/utils';

import fixtures from './fixtures/utils';

describe('utils', () => {
  describe('#convertStringToObj', () => {
    test('should return object from string', () => {
      const str = 'CN=1, MN=2';
      const result = { CN: '1', MN: '2' };

      const subject = convertStringToObj(str);

      expect(subject).toEqual(result);
    });
  });

  describe('#injectToXML', () => {
    test('should return transformed xml', () => {
      const signatureValue = '111';
      const x509certificate = '222';

      const subject = injectToXML(
        fixtures.injectToXML.xml,
        signatureValue,
        x509certificate,
      );

      expect(subject).toEqual(fixtures.injectToXML.result);
    });
  });
});

@@ -46,16 +46,31 @@
 gToObj,%0A
+  hexToBase64,%0A
   inject
@@ -441,16 +441,320 @@
 %0A  %7D);%0A%0A
+  describe('#hexToBase64', () =%3E %7B%0A    test('should return base64 from hex', () =%3E %7B%0A      const hex = 'a660b03bc56d364fce9c482632b9f864';%0A      const result = 'ZPi5MiZInM5PNm3FO7Bgpg==';%0A%0A      const subject = hexToBase64(hex, '', hex.length - 2);%0A%0A      expect(subject).toEqual(result);%0A    %7D);%0A  %7D);%0A%0A
   descri

test for hexToBase64 function