diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-06 14:47:48 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-06-10 19:03:57 -0400 |
commit | 5dbc79d046ed63444895cf8720165b95b9906735 (patch) | |
tree | 4411f7030701dac669b566b77b4e91342e040584 /test | |
parent | 15ebb483d896916553ba5d729c22be4e545cc08a (diff) |
Structured content updates (#1733)
* Add support for imageRendering
* Make crisp-edges appearance on Firefox more similar to Chrome
* Refactor
* Add background option
* Move data-image-rendering attribute
* Restructure
* Organize
* Add support for appearance
* Update test dictionary
* Update tests
Diffstat (limited to 'test')
-rw-r--r-- | test/data/dictionaries/valid-dictionary1/character.gif | bin | 0 -> 107 bytes | |||
-rw-r--r-- | test/data/dictionaries/valid-dictionary1/term_bank_1.json | 23 | ||||
-rw-r--r-- | test/test-database.js | 4 |
3 files changed, 25 insertions, 2 deletions
diff --git a/test/data/dictionaries/valid-dictionary1/character.gif b/test/data/dictionaries/valid-dictionary1/character.gif Binary files differnew file mode 100644 index 00000000..9d5edad8 --- /dev/null +++ b/test/data/dictionaries/valid-dictionary1/character.gif diff --git a/test/data/dictionaries/valid-dictionary1/term_bank_1.json b/test/data/dictionaries/valid-dictionary1/term_bank_1.json index 0df04ef0..1ba70c26 100644 --- a/test/data/dictionaries/valid-dictionary1/term_bank_1.json +++ b/test/data/dictionaries/valid-dictionary1/term_bank_1.json @@ -36,6 +36,29 @@ "naiyou definition 6: ", {"tag": "ruby", "content": ["内", {"tag": "rp", "content": "("}, {"tag": "rt", "content": "ない"}, {"tag": "rp", "content": ")"}]}, {"tag": "ruby", "content": ["容", {"tag": "rp", "content": "("}, {"tag": "rt", "content": "よう"}, {"tag": "rp", "content": ")"}]} + ]}, + {"type": "structured-content", "content": [ + "imageRendering=auto: ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "auto", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢 ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "auto", "background": false, "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢 ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "auto", "background": false, "appearance": "monochrome", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢\n", + "imageRendering=pixelated: ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "pixelated", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢 ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "pixelated", "background": false, "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢 ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "pixelated", "background": false, "appearance": "monochrome", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢\n", + "imageRendering=crisp-edges: ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "crisp-edges", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢 ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "crisp-edges", "background": false, "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢 ", + {"tag": "img", "path": "character.gif", "width": 1, "height": 1, "imageRendering": "crisp-edges", "background": false, "appearance": "monochrome", "collapsible": false, "collapsed": false, "sizeUnits": "em"}, + "莢\n" ]} ], 9, "P E1" diff --git a/test/test-database.js b/test/test-database.js index e68a39ba..d4005364 100644 --- a/test/test-database.js +++ b/test/test-database.js @@ -162,8 +162,8 @@ async function testDatabase1() { true ); vm.assert.deepStrictEqual(counts, { - counts: [{kanji: 2, kanjiMeta: 2, terms: 15, termMeta: 12, tagMeta: 15, media: 1}], - total: {kanji: 2, kanjiMeta: 2, terms: 15, termMeta: 12, tagMeta: 15, media: 1} + counts: [{kanji: 2, kanjiMeta: 2, terms: 15, termMeta: 12, tagMeta: 15, media: 2}], + total: {kanji: 2, kanjiMeta: 2, terms: 15, termMeta: 12, tagMeta: 15, media: 2} }); // Test find* functions |