summaryrefslogtreecommitdiff
path: root/test/test-options-util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-11-12 20:34:11 -0500
committerGitHub <noreply@github.com>2020-11-12 20:34:11 -0500
commitec021964b7311d02fdbc5531564074f145043b91 (patch)
tree7d82366ed48e64c3dbad00e37a5f717134c59439 /test/test-options-util.js
parentf2ad94e54f2a110bf93aebfae33c808c497005be (diff)
Compact tags refactor (#1021)
* Update translator to flag redundant tags instead of remove * Update how compact tags are shown in the popup * Pass compactTags option to note builder * Update options templates * Add options upgrade * Add options upgrade test
Diffstat (limited to 'test/test-options-util.js')
-rw-r--r--test/test-options-util.js73
1 files changed, 73 insertions, 0 deletions
diff --git a/test/test-options-util.js b/test/test-options-util.js
index 6b04cb02..378338c9 100644
--- a/test/test-options-util.js
+++ b/test/test-options-util.js
@@ -608,6 +608,79 @@ ${update2}
${update4}
${update6}
{{~> (lookup . "marker") ~}}`.trimStart()
+ },
+ // Definition tags update
+ {
+ old: `
+{{#*inline "glossary-single"}}
+ {{~#unless brief~}}
+ {{~#if definitionTags~}}<i>({{#each definitionTags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}})</i> {{/if~}}
+ {{~#if only~}}({{#each only}}{{{.}}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
+ {{~/unless~}}
+{{/inline}}
+
+{{#*inline "glossary-single2"}}
+ {{~#unless brief~}}
+ {{~#if definitionTags~}}<i>({{#each definitionTags}}{{name}}{{#unless @last}}, {{/unless}}{{/each}})</i> {{/if~}}
+ {{~#if only~}}({{#each only}}{{{.}}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
+ {{~/unless~}}
+{{/inline}}
+
+{{#*inline "glossary"}}
+ {{~> glossary-single definition brief=brief compactGlossaries=compactGlossaries~}}
+ {{~> glossary-single definition brief=brief compactGlossaries=../compactGlossaries~}}
+{{/inline}}
+
+{{~> (lookup . "marker") ~}}
+`.trimStart(),
+
+ expected: `
+{{#*inline "glossary-single"}}
+ {{~#unless brief~}}
+ {{~#scope~}}
+ {{~#set "any" false}}{{/set~}}
+ {{~#if definitionTags~}}{{#each definitionTags~}}
+ {{~#if (op "||" (op "!" ../data.compactTags) (op "!" redundant))~}}
+ {{~#if (get "any")}}, {{else}}<i>({{/if~}}
+ {{name}}
+ {{~#set "any" true}}{{/set~}}
+ {{~/if~}}
+ {{~/each~}}
+ {{~#if (get "any")}})</i> {{/if~}}
+ {{~/if~}}
+ {{~/scope~}}
+ {{~#if only~}}({{#each only}}{{{.}}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
+ {{~/unless~}}
+{{/inline}}
+
+{{#*inline "glossary-single2"}}
+ {{~#unless brief~}}
+ {{~#scope~}}
+ {{~#set "any" false}}{{/set~}}
+ {{~#if definitionTags~}}{{#each definitionTags~}}
+ {{~#if (op "||" (op "!" ../data.compactTags) (op "!" redundant))~}}
+ {{~#if (get "any")}}, {{else}}<i>({{/if~}}
+ {{name}}
+ {{~#set "any" true}}{{/set~}}
+ {{~/if~}}
+ {{~/each~}}
+ {{~#if (get "any")}})</i> {{/if~}}
+ {{~/if~}}
+ {{~/scope~}}
+ {{~#if only~}}({{#each only}}{{{.}}}{{#unless @last}}, {{/unless}}{{/each}} only) {{/if~}}
+ {{~/unless~}}
+{{/inline}}
+
+{{#*inline "glossary"}}
+ {{~> glossary-single definition brief=brief compactGlossaries=compactGlossaries data=.~}}
+ {{~> glossary-single definition brief=brief compactGlossaries=../compactGlossaries data=../.~}}
+{{/inline}}
+
+${update2}
+${update4}
+${update6}
+{{~> (lookup . "marker") ~}}
+`.trimStart()
}
];