Update simple test (#1551)

* Test null for simple mode

* Update test data
This commit is contained in:
toasted-nutbread 2021-03-23 22:44:20 -04:00 committed by GitHub
parent 022154c3e1
commit cda04b576d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 263 deletions

View File

@ -998,268 +998,7 @@
},
{
"name": "Search using different modes",
"results": [
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち込む",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打ち込む",
"frequencies": "",
"furigana": "<ruby>打<rt>う</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
"furigana-plain": "打[う]ち 込[こ]む",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition13</li><li>definition14</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition13</li><li>definition14</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition13</li><li>definition14</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "うちこむ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ち込むcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち込む",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打ち込む",
"frequencies": "",
"furigana": "<ruby>打<rt>ぶ</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
"furigana-plain": "打[ぶ]ち 込[こ]む",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition17</li><li>definition18</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition17</li><li>definition18</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition17</li><li>definition18</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "ぶちこむ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ち込むcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち込む",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打ち込む",
"frequencies": "",
"furigana": "<ruby>打<rt>う</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
"furigana-plain": "打[う]ち 込[こ]む",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition15</li><li>definition16</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition15</li><li>definition16</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition15</li><li>definition16</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "うちこむ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ち込むcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち込む",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打ち込む",
"frequencies": "",
"furigana": "<ruby>打<rt>ぶ</rt></ruby>ち<ruby>込<rt>こ</rt></ruby>む",
"furigana-plain": "打[ぶ]ち 込[こ]む",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition19</li><li>definition20</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition19</li><li>definition20</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition19</li><li>definition20</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "ぶちこむ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ち込むcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "masu stem",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打つ",
"frequencies": "",
"furigana": "<ruby>打<rt>う</rt></ruby>つ",
"furigana-plain": "打[う]つ",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition5</li><li>definition6</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition5</li><li>definition6</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition5</li><li>definition6</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "うつ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ちcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "masu stem",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打つ",
"frequencies": "",
"furigana": "<ruby>打<rt>ぶ</rt></ruby>つ",
"furigana-plain": "打[ぶ]つ",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition9</li><li>definition10</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition9</li><li>definition10</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition9</li><li>definition10</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "ぶつ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ちcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "masu stem",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打つ",
"frequencies": "",
"furigana": "<ruby>打<rt>う</rt></ruby>つ",
"furigana-plain": "打[う]つ",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition7</li><li>definition8</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition7</li><li>definition8</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition7</li><li>definition8</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "うつ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ちcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打ち",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "masu stem",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打つ",
"frequencies": "",
"furigana": "<ruby>打<rt>ぶ</rt></ruby>つ",
"furigana-plain": "打[ぶ]つ",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition11</li><li>definition12</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition11</li><li>definition12</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition11</li><li>definition12</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "ぶつ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打ちcloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打",
"frequencies": "",
"furigana": "<ruby>打<rt>だ</rt></ruby>",
"furigana-plain": "打[だ]",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition1</li><li>definition2</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition1</li><li>definition2</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition1</li><li>definition2</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "だ",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打cloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
},
{
"audio": "",
"clipboard-image": "",
"clipboard-text": "",
"cloze-body": "打",
"cloze-prefix": "cloze-prefix",
"cloze-suffix": "cloze-suffix",
"conjugation": "",
"dictionary": "Test Dictionary 2",
"document-title": "title",
"expression": "打",
"frequencies": "",
"furigana": "<ruby>打<rt>ダース</rt></ruby>",
"furigana-plain": "打[ダース]",
"glossary": "<div style=\"text-align: left;\"><i>(tag1, tag2, Test Dictionary 2)</i> <ul><li>definition3</li><li>definition4</li></ul></div>",
"glossary-brief": "<div style=\"text-align: left;\"><ul><li>definition3</li><li>definition4</li></ul></div>",
"glossary-no-dictionary": "<div style=\"text-align: left;\"><i>(tag1, tag2)</i> <ul><li>definition3</li><li>definition4</li></ul></div>",
"pitch-accents": "No pitch accent data",
"pitch-accent-graphs": "No pitch accent data",
"pitch-accent-positions": "No pitch accent data",
"reading": "ダース",
"screenshot": "<img src=\"\" />",
"sentence": "cloze-prefix打cloze-suffix",
"tags": "tag1, tag2",
"url": "<a href=\"url:\">url:</a>"
}
]
"results": null
},
{
"name": "Search using different modes",

View File

@ -194,7 +194,7 @@ async function main() {
const {name, mode, text} = test;
const options = vm.buildOptions(optionsPresets, test.options);
const [definitions] = clone(await vm.translator.findTerms(mode, text, options));
const results = clone(await getRenderResults(definitions, 'terms', mode, templates, AnkiNoteBuilder, write));
const results = mode !== 'simple' ? clone(await getRenderResults(definitions, 'terms', mode, templates, AnkiNoteBuilder, write)) : null;
actualResults1.push({name, results});
if (!write) {
assert.deepStrictEqual(results, expected1.results);