summaryrefslogtreecommitdiff
path: root/test/dictionary-data.write.js
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-06-20 19:27:02 +0200
committerGitHub <noreply@github.com>2024-06-20 17:27:02 +0000
commitd2c930a94d6e445053bcb5e5bb629851165425fc (patch)
tree94ff7034e7d3ab36ed663f353aeb5486bd294d1c /test/dictionary-data.write.js
parent1a866b3997310a04fc146b91eb47a59a3f049589 (diff)
support css file in dictionaries (#1080)
* get styles in db * get styles in settings * use styles * fix test * scope * fix comma separated * escape dict name in css selector * g regex * get styles in anki * fix tests * more specificity * whitespace * test importing * test handlebars * add styles to glossary-first
Diffstat (limited to 'test/dictionary-data.write.js')
-rw-r--r--test/dictionary-data.write.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/dictionary-data.write.js b/test/dictionary-data.write.js
index 16cb8d88..880d2379 100644
--- a/test/dictionary-data.write.js
+++ b/test/dictionary-data.write.js
@@ -35,7 +35,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
const dictionaryName = 'Test Dictionary 2';
const test = await createTranslatorTest(void 0, path.join(dirname, 'data/dictionaries/valid-dictionary1'), dictionaryName);
-test('Write dictionary data expected data', async ({window, translator, expect}) => {
+test('Write dictionary data expected data', async ({window, translator, styles, expect}) => {
// The window property needs to be referenced for it to be initialized.
// It is needed for DOM access for structured content.
void window;
@@ -64,8 +64,8 @@ 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, mode, template, null) : null;
- const noteDataList = mode !== 'simple' ? dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, mode)) : null;
+ const renderResults = mode !== 'simple' ? await getTemplateRenderResults(dictionaryEntries, mode, template, null, styles) : null;
+ const noteDataList = mode !== 'simple' ? dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, mode, styles)) : null;
actualResults1.push({name, originalTextLength, dictionaryEntries});
actualResults2.push({name, noteDataList});
actualResults3.push({name, results: renderResults});