crypto-pro-js/src/api/certificate/getCadesProp.test.ts
2020-03-28 21:11:00 +03:00

28 lines
672 B
TypeScript

import 'cadesplugin';
import { getCadesProp } from './getCadesProp';
const cadesPropertyContentMock = 'content of a cades property';
const executionSteps = [Symbol('step 0')];
const executionFlow = {
[executionSteps[0]]: cadesPropertyContentMock,
};
window.cadesplugin.__defineExecutionFlow(executionFlow);
describe('getCadesProp', () => {
test('returns contents of a cades prop', async () => {
const cadesPropertyContent = await getCadesProp.call(
{
_cadesCertificate: {
cadesProperty: executionSteps[0],
},
},
'cadesProperty',
);
expect(cadesPropertyContent).toEqual(cadesPropertyContentMock);
});
});