diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-02-05 06:16:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 11:16:00 +0000 |
commit | 576dece97e6546aea774d1bac4a05b7854c512a4 (patch) | |
tree | f9b9b1c167a0156221ecef275f23d53acf519dae /test/dictionary-data.write.js | |
parent | 71c3aff53173cc83a96d7d2715b7918bdbc2d8a5 (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.write.js')
-rw-r--r-- | test/dictionary-data.write.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/dictionary-data.write.js b/test/dictionary-data.write.js index a6e14656..b271da57 100644 --- a/test/dictionary-data.write.js +++ b/test/dictionary-data.write.js @@ -64,7 +64,7 @@ test('Write dictionary data expected data', async ({window, translator, expect}) 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, null) : null; + const renderResults = mode !== 'simple' ? await getTemplateRenderResults(dictionaryEntries, mode, template, null) : null; const noteDataList = mode !== 'simple' ? dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, mode)) : null; actualResults1.push({name, originalTextLength, dictionaryEntries}); actualResults2.push({name, noteDataList}); @@ -76,7 +76,7 @@ test('Write dictionary data expected data', async ({window, translator, expect}) 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, null); + const renderResults = await getTemplateRenderResults(dictionaryEntries, 'split', template, null); const noteDataList = dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, 'split')); actualResults1.push({name, dictionaryEntries}); actualResults2.push({name, noteDataList}); |