"use strict";
/***************** This file is autogenerated *****************************
Please don't modify it manually !
Instead, to update the file, run :
npm run test:es6:update-snapshots
*/
exports["Api versioning should fail with invalid versions"] = {
"_type": "XTAPIVersionError",
"name": "APIVersionError",
"message": "neededVersion is not a valid version",
"properties": {
"id": "api_version_error",
"neededVersion": [5, 0],
"explanation": "the neededVersion must be an array of length 3"
}
};
exports["Api versioning should fail with invalid versions-1"] = {
"_type": "XTAPIVersionError",
"name": "APIVersionError",
"message": "The major api version do not match, you probably have to update docxtemplater with npm install --save docxtemplater",
"properties": {
"id": "api_version_error",
"neededVersion": [5, 6, 0],
"currentModuleApiVersion": [3, 38, 0],
"explanation": "moduleAPIVersionMismatch : needed=5.6.0, current=3.38.0"
}
};
exports["Api versioning should fail with invalid versions-2"] = {
"_type": "XTAPIVersionError",
"name": "APIVersionError",
"message": "The minor api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",
"properties": {
"id": "api_version_error",
"neededVersion": [3, 44, 0],
"currentModuleApiVersion": [3, 38, 0],
"explanation": "moduleAPIVersionMismatch : needed=3.44.0, current=3.38.0"
}
};
exports["Api versioning should fail with invalid versions-3"] = {
"_type": "XTAPIVersionError",
"name": "APIVersionError",
"message": "The patch api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater",
"properties": {
"id": "api_version_error",
"neededVersion": [3, 38, 100],
"currentModuleApiVersion": [3, 38, 0],
"explanation": "moduleAPIVersionMismatch : needed=3.38.100, current=3.38.0"
}
};
exports["Compilation errors should count 3 errors when having rawxml and two other errors"] = {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Multi error",
"properties": {
"errors": [{
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened tag",
"properties": {
"xtag": "foo",
"id": "unopened_tag",
"context": "foo",
"offset": 3,
"explanation": "The tag beginning with \"foo\" is unopened",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened tag",
"properties": {
"xtag": "bar",
"id": "unopened_tag",
"context": "} bar",
"offset": 16,
"explanation": "The tag beginning with \"} bar\" is unopened",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Raw tag should be the only text in paragraph",
"properties": {
"id": "raw_xml_tag_should_be_only_text_in_paragraph",
"explanation": "The raw tag \"bang\" should be the only text in this paragraph. This means that this tag should not be surrounded by any text or spaces.",
"xtag": "bang",
"offset": 5,
"paragraphParts": [{
"type": "tag",
"position": "start",
"text": false,
"value": "",
"tag": "w:r",
"lIndex": 1
}, {
"type": "tag",
"position": "start",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 2
}, {
"type": "content",
"value": "foo",
"position": "insidetag",
"lIndex": 3
}, {
"type": "placeholder",
"value": "",
"endLindex": 4,
"lIndex": 4
}, {
"type": "content",
"value": " ",
"position": "insidetag",
"lIndex": 5
}, {
"type": "placeholder",
"module": "rawxml",
"value": "bang",
"offset": 5,
"endLindex": 8,
"lIndex": 8,
"raw": "@bang"
}, {
"type": "content",
"value": " bar",
"position": "insidetag",
"lIndex": 9
}, {
"type": "placeholder",
"value": "",
"offset": 5,
"endLindex": 10,
"lIndex": 10
}, {
"type": "tag",
"position": "end",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 11
}, {
"type": "tag",
"position": "end",
"text": false,
"value": "",
"tag": "w:r",
"lIndex": 12
}],
"file": "word/document.xml"
}
}],
"id": "multi_error",
"explanation": "The template has multiple errors"
}
};
exports["Compilation errors should fail early when a loop closes the wrong loop"] = {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Multi error",
"properties": {
"errors": [{
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened loop",
"properties": {
"id": "unopened_loop",
"explanation": "The loop with tag \"loop3\" is unopened",
"xtag": "loop3",
"offset": 16,
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened loop",
"properties": {
"id": "unopened_loop",
"explanation": "The loop with tag \"loop3\" is unopened",
"xtag": "loop3",
"offset": 24,
"file": "word/document.xml"
}
}],
"id": "multi_error",
"explanation": "The template has multiple errors"
}
};
exports["Compilation errors should fail when rawtag is in table without paragraph"] = {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Multi error",
"properties": {
"errors": [{
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Raw tag not in paragraph",
"properties": {
"id": "raw_tag_outerxml_invalid",
"explanation": "The tag \"myrawtag\" is not inside a paragraph, putting raw tags inside an inline loop is disallowed.",
"rootError": {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "No tag \"w:p\" was found at the left",
"properties": {
"id": "no_xml_tag_found_at_left",
"explanation": "No tag \"w:p\" was found at the left",
"offset": 0,
"part": {
"type": "placeholder",
"module": "rawxml",
"value": "myrawtag",
"offset": 0,
"endLindex": 4,
"lIndex": 4,
"raw": "@myrawtag"
},
"parsed": [{
"type": "tag",
"position": "start",
"text": false,
"value": "",
"tag": "w:tbl",
"lIndex": 0
}, {
"type": "tag",
"position": "start",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 1
}, {
"type": "placeholder",
"module": "rawxml",
"value": "myrawtag",
"offset": 0,
"endLindex": 4,
"lIndex": 4,
"raw": "@myrawtag"
}, {
"type": "tag",
"position": "end",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 5
}, {
"type": "tag",
"position": "end",
"text": false,
"value": "",
"tag": "w:p",
"lIndex": 6
}, {
"type": "tag",
"position": "end",
"text": false,
"value": "",
"tag": "w:tbl",
"lIndex": 7
}],
"index": 2,
"element": "w:p"
}
},
"xtag": "myrawtag",
"offset": 0,
"postparsed": [{
"type": "tag",
"position": "start",
"text": false,
"value": "",
"tag": "w:tbl",
"lIndex": 0
}, {
"type": "tag",
"position": "start",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 1
}, {
"type": "placeholder",
"module": "rawxml",
"value": "myrawtag",
"offset": 0,
"endLindex": 4,
"lIndex": 4,
"raw": "@myrawtag"
}, {
"type": "tag",
"position": "end",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 5
}, {
"type": "tag",
"position": "end",
"text": false,
"value": "",
"tag": "w:p",
"lIndex": 6
}, {
"type": "tag",
"position": "end",
"text": false,
"value": "",
"tag": "w:tbl",
"lIndex": 7
}],
"expandTo": "w:p",
"index": 2,
"file": "word/document.xml"
}
}],
"id": "multi_error",
"explanation": "The template has multiple errors"
}
};
exports["Compilation errors should fail when rawtag is not in paragraph"] = {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Multi error",
"properties": {
"errors": [{
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Raw tag not in paragraph",
"properties": {
"id": "raw_tag_outerxml_invalid",
"explanation": "The tag \"myrawtag\" is not inside a paragraph, putting raw tags inside an inline loop is disallowed.",
"rootError": {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "No tag \"w:p\" was found at the left",
"properties": {
"id": "no_xml_tag_found_at_left",
"explanation": "No tag \"w:p\" was found at the left",
"offset": 0,
"part": {
"type": "placeholder",
"module": "rawxml",
"value": "myrawtag",
"offset": 0,
"endLindex": 3,
"lIndex": 3,
"raw": "@myrawtag"
},
"parsed": [{
"type": "tag",
"position": "start",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 0
}, {
"type": "placeholder",
"module": "rawxml",
"value": "myrawtag",
"offset": 0,
"endLindex": 3,
"lIndex": 3,
"raw": "@myrawtag"
}, {
"type": "tag",
"position": "end",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 4
}],
"index": 1,
"element": "w:p"
}
},
"xtag": "myrawtag",
"offset": 0,
"postparsed": [{
"type": "tag",
"position": "start",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 0
}, {
"type": "placeholder",
"module": "rawxml",
"value": "myrawtag",
"offset": 0,
"endLindex": 3,
"lIndex": 3,
"raw": "@myrawtag"
}, {
"type": "tag",
"position": "end",
"text": true,
"value": "",
"tag": "w:t",
"lIndex": 4
}],
"expandTo": "w:p",
"index": 1,
"file": "word/document.xml"
}
}],
"id": "multi_error",
"explanation": "The template has multiple errors"
}
};
exports["Inspect module should get all tags (pptx file)"] = [{
"type": "placeholder",
"value": "tag",
"offset": 0,
"endLindex": 36,
"lIndex": 36
}];
exports["Inspect module should get main tags"] = [{
"type": "placeholder",
"module": "loop",
"inverted": false,
"value": "offre",
"offset": 29,
"endLindex": 332,
"lIndex": 188,
"raw": "#offre",
"sectPrCount": 0,
"lastParagrapSectPr": "",
"subparsed": [{
"type": "placeholder",
"value": "nom",
"offset": 37,
"endLindex": 214,
"lIndex": 214
}, {
"type": "placeholder",
"value": "prix",
"offset": 48,
"endLindex": 241,
"lIndex": 241
}, {
"type": "placeholder",
"value": "titre",
"offset": 60,
"endLindex": 268,
"lIndex": 268
}]
}, {
"type": "placeholder",
"value": "nom",
"offset": 75,
"endLindex": 354,
"lIndex": 354
}, {
"type": "placeholder",
"value": "prenom",
"offset": 80,
"endLindex": 378,
"lIndex": 378
}];
exports["Multi errors should work with loops unopened"] = {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Multi error",
"properties": {
"errors": [{
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened loop",
"properties": {
"id": "unopened_loop",
"explanation": "The loop with tag \"loop\" is unopened",
"xtag": "loop",
"offset": 0,
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Closing tag does not match opening tag",
"properties": {
"id": "closing_tag_does_not_match_opening_tag",
"explanation": "The tag \"users\" is closed by the tag \"foo\"",
"openingtag": "users",
"offset": [8, 25],
"closingtag": "foo",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Closing tag does not match opening tag",
"properties": {
"id": "closing_tag_does_not_match_opening_tag",
"explanation": "The tag \"bang\" is closed by the tag \"baz\"",
"openingtag": "bang",
"offset": [34, 50],
"closingtag": "baz",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened loop",
"properties": {
"id": "unopened_loop",
"explanation": "The loop with tag \"fff\" is unopened",
"xtag": "fff",
"offset": 59,
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unclosed loop",
"properties": {
"id": "unclosed_loop",
"explanation": "The loop with tag \"yum\" is unclosed",
"xtag": "yum",
"offset": 68,
"file": "word/document.xml"
}
}],
"id": "multi_error",
"explanation": "The template has multiple errors"
}
};
exports["Multi errors should work with multiple errors complex"] = {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Multi error",
"properties": {
"errors": [{
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened tag",
"properties": {
"xtag": "foo",
"id": "unopened_tag",
"context": "foo",
"offset": 3,
"explanation": "The tag beginning with \"foo\" is unopened",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unclosed tag",
"properties": {
"xtag": "user,",
"id": "unclosed_tag",
"context": "{user, my age is ",
"offset": 11,
"explanation": "The tag beginning with \"{user, my \" is unclosed",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unopened tag",
"properties": {
"xtag": "bang",
"id": "unopened_tag",
"context": "}!Hi bang",
"offset": 41,
"explanation": "The tag beginning with \"}!Hi bang\" is unopened",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unclosed tag",
"properties": {
"xtag": "user,",
"id": "unclosed_tag",
"context": "{user, my age is ",
"offset": 123,
"explanation": "The tag beginning with \"{user, my \" is unclosed",
"file": "word/document.xml"
}
}, {
"_type": "XTTemplateError",
"name": "TemplateError",
"message": "Unclosed tag",
"properties": {
"xtag": "bar!",
"id": "unclosed_tag",
"context": "{bar!",
"offset": 140,
"explanation": "The tag beginning with \"{bar!\" is unclosed",
"file": "word/document.xml"
}
}],
"id": "multi_error",
"explanation": "The template has multiple errors"
}
};
exports["ParagraphLoop should not fail when having paragraph in paragraph"] = "\n(0)\n(0)\n(1) \n*********START LOOP OF hi\n(3) \n(4) \n(5) \n(5) \n(4) \n(4) \n(4) \n(5) \n(5) \n(6) \n(6) \n(7) \n(7) \n(8) \n(8) \n(9) \n(9) \n(10) \n(11) \n(12) name\n(11) \n(10) \n(9) \n(8) \n(8) \n(9) \n(9) \n(10) \n(11) \n(12) phone\n(11) \n(10) \n(9) \n(8) \n(8) \n(9) \n(9) \n(10) \n(11) \n(12) website\n(11) \n(10) \n(9) \n(8) \n(7) \n(7) \n(8) \n(9) \n(9) \n(10) \n(11) \n(11) \n(12) \n(13) \n(13) \n(12) \n(12) \n(13) \n=============================================={foo}\n(13) \n(12) \n(11) \n(10) \n(9) \n(8) \n(8) \n(9) \n(9) \n(10) \n(11) \n(11) \n(12) \n(13) \n(13) \n(12) \n(12) \n(13) \n=============================================={bar}\n(13) \n(12) \n(11) \n(10) \n(9) \n(8) \n(8) \n(9) \n(9) \n(10) \n(11) \n(11) \n(12) \n(13) \n(13) \n(12) \n(12) \n(13) \n=============================================={bar}\n(13) \n(12) \n(11) \n(10) \n(9) \n(8) \n(7) \n(6) \n(6) \n(5) \n(4) \n(4) \n(3) \n*********END LOOP OF hi\n(1) \n(0)";
exports["Pptx generation should work with loop table"] = [{
"tag": "products",
"lIndex": 59,
"value": [[{
"tag": "name",
"lIndex": 62,
"value": "Acme"
}, {
"tag": "price",
"lIndex": 80,
"value": 10
}], [{
"tag": "name",
"lIndex": 62,
"value": "Ecma"
}, {
"tag": "price",
"lIndex": 80,
"value": 20
}]]
}];