summaryrefslogtreecommitdiff
path: root/test/dictionary-data.test.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-05 06:16:00 -0500
committerGitHub <noreply@github.com>2024-02-05 11:16:00 +0000
commit576dece97e6546aea774d1bac4a05b7854c512a4 (patch)
treef9b9b1c167a0156221ecef275f23d53acf519dae /test/dictionary-data.test.js
parent71c3aff53173cc83a96d7d2715b7918bdbc2d8a5 (diff)
Reduce repeated anki field marker code (#632)
* Unify repeated code for getting anki field markers * Throw because type safety exists * Simplify * Update order * Update test data
Diffstat (limited to 'test/dictionary-data.test.js')
-rw-r--r--test/dictionary-data.test.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dictionary-data.test.js b/test/dictionary-data.test.js
index dcc03d72..bf2d0ace 100644
--- a/test/dictionary-data.test.js
+++ b/test/dictionary-data.test.js
@@ -63,7 +63,7 @@ describe('Dictionary data', () => {
const {mode, text} = data;
const options = createFindTermsOptions(dictionaryName, optionsPresets, data.options);
const {dictionaryEntries, originalTextLength} = await translator.findTerms(mode, text, options);
- const renderResults = mode !== 'simple' ? await getTemplateRenderResults(dictionaryEntries, 'terms', mode, template, expect) : null;
+ const renderResults = mode !== 'simple' ? await getTemplateRenderResults(dictionaryEntries, mode, template, expect) : null;
const noteDataList = mode !== 'simple' ? dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, mode)) : null;
expect.soft(originalTextLength).toStrictEqual(expected1.originalTextLength);
expect.soft(dictionaryEntries).toStrictEqual(expected1.dictionaryEntries);
@@ -76,7 +76,7 @@ describe('Dictionary data', () => {
const {text} = data;
const options = createFindKanjiOptions(dictionaryName, optionsPresets, data.options);
const dictionaryEntries = await translator.findKanji(text, options);
- const renderResults = await getTemplateRenderResults(dictionaryEntries, 'kanji', 'split', template, expect);
+ const renderResults = await getTemplateRenderResults(dictionaryEntries, 'split', template, expect);
const noteDataList = dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, 'split'));
expect.soft(dictionaryEntries).toStrictEqual(expected1.dictionaryEntries);
expect.soft(noteDataList).toEqual(expected2.noteDataList);