diff options
author | StefanVukovic99 <stefanvukovic44@gmail.com> | 2024-06-20 19:27:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 17:27:02 +0000 |
commit | d2c930a94d6e445053bcb5e5bb629851165425fc (patch) | |
tree | 94ff7034e7d3ab36ed663f353aeb5486bd294d1c /test/dictionary-data.test.js | |
parent | 1a866b3997310a04fc146b91eb47a59a3f049589 (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.test.js')
-rw-r--r-- | test/dictionary-data.test.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/dictionary-data.test.js b/test/dictionary-data.test.js index e55496e4..cfb951d8 100644 --- a/test/dictionary-data.test.js +++ b/test/dictionary-data.test.js @@ -53,7 +53,7 @@ describe('Dictionary data', () => { expected3: expectedResults3[i], })); describe.each(testCases)('Test %#: $data.name', ({data, expected1, expected2, expected3}) => { - test('Test', async ({window, translator, expect}) => { + test('Test', 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; @@ -63,8 +63,8 @@ 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, mode, template, expect) : null; - const noteDataList = mode !== 'simple' ? dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, mode)) : null; + const renderResults = mode !== 'simple' ? await getTemplateRenderResults(dictionaryEntries, mode, template, expect, styles) : null; + const noteDataList = mode !== 'simple' ? dictionaryEntries.map((dictionaryEntry) => createTestAnkiNoteData(dictionaryEntry, mode, styles)) : null; expect.soft(originalTextLength).toStrictEqual(expected1.originalTextLength); expect.soft(dictionaryEntries).toStrictEqual(expected1.dictionaryEntries); expect.soft(noteDataList).toEqual(expected2.noteDataList); |