1 import archive from '../../fixtures/archive';
2 import folder from '../../fixtures/folder';
3 import v1StartsEndsTest from '../../fixtures/v1StartsEndsTest';
4 import v2 from '../../fixtures/v2';
5 import v2Attachments from '../../fixtures/v2Attachments';
6 import v2Complex from '../../fixtures/v2Complex';
7 import v2EscapeVariables from '../../fixtures/v2EscapeVariables';
8 import v2From from '../../fixtures/v2From';
9 import v2StartsEndsTest from '../../fixtures/v2StartsEndsTest';
10 import v2Vacation from '../../fixtures/v2Vacation';
11 import { toSieveTree } from './toSieveTree';
13 describe('To Tree testing', () => {
14 it('toSieveTree - Should match simple test', () => {
15 const { simple, tree } = archive;
16 const generated = toSieveTree(simple, 1);
17 expect(generated).toEqual(tree);
20 it('toSieveTree - Should match on folders mapping', () => {
21 const { simple, tree } = folder;
22 const generated = toSieveTree(simple, 1);
23 expect(generated).toEqual(tree);
26 it('toSieveTree - Should match on v2', () => {
27 const { simple, tree } = v2;
28 const generated = toSieveTree(simple, 2);
29 expect(generated).toEqual(tree);
32 it('toSieveTree - Should match on v1 with tree', () => {
33 const { simple, tree } = v1StartsEndsTest;
34 const generated = toSieveTree(simple, 1);
35 expect(generated).toEqual(tree);
38 it('toSieveTree - Should match on v2 with tree', () => {
39 const { simple, tree } = v2StartsEndsTest;
40 const generated = toSieveTree(simple, 2);
41 expect(generated).toEqual(tree);
44 it('toSieveTree - Should match on v2 with attachments', () => {
45 const { simple, tree } = v2Attachments;
46 const generated = toSieveTree(simple, 2);
47 expect(generated).toEqual(tree);
50 it('toSieveTree - Should match on v2 with vacation', () => {
51 const { simple, tree } = v2Vacation;
52 const generated = toSieveTree(simple, 2);
53 expect(generated).toEqual(tree);
56 it('toSieveTree - Should match on v2 with from', () => {
57 const { simple, tree } = v2From;
58 const generated = toSieveTree(simple, 2);
59 expect(generated).toEqual(tree);
62 it('toSieveTree - Should match on v2 with complex', () => {
63 const { simple, tree } = v2Complex;
64 const generated = toSieveTree(simple, 2);
65 expect(generated).toEqual(tree);
68 it('toSieveTree - Should match on v2 with escape variables', () => {
69 const { simple, tree } = v2EscapeVariables;
70 const generated = toSieveTree(simple, 2);
71 expect(generated).toEqual(tree);