import { aktionenAbEntscheidung } from './paperless-entscheidung.util'; const MAIL = { ActionType: 'MAIL' }; const PAPERLESS = { ActionType: 'PAPERLESS' }; const EXPORT = { ActionType: 'EXPORT' }; describe('aktionenAbEntscheidung', () => { it('ohne Entscheidung laufen alle Aktionen', () => { expect(aktionenAbEntscheidung([MAIL, PAPERLESS, EXPORT])).toEqual([ MAIL, PAPERLESS, EXPORT, ]); }); it('nach „Verwerfen“ laufen Aktionen vor PAPERLESS nicht doppelt, die danach schon', () => { expect( aktionenAbEntscheidung([MAIL, PAPERLESS, EXPORT], { aktion: 'verwerfen', }), ).toEqual([PAPERLESS, EXPORT]); }); it('nach „Version“ geht es ab der PAPERLESS-Aktion weiter', () => { expect( aktionenAbEntscheidung([MAIL, PAPERLESS, EXPORT], { aktion: 'version', documentId: 1, }), ).toEqual([PAPERLESS, EXPORT]); }); it('ohne PAPERLESS-Aktion laufen trotz Entscheidung alle', () => { expect( aktionenAbEntscheidung([MAIL, EXPORT], { aktion: 'verwerfen' }), ).toEqual([MAIL, EXPORT]); }); });