From ce50a28263b8727948b388faf29e653329bba802 Mon Sep 17 00:00:00 2001 From: Yuki Hattori Date: Tue, 12 Sep 2023 01:45:25 +0900 Subject: [PATCH] Add integrated unit testing for accessible advanced background image --- test/marpit.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/marpit.js b/test/marpit.js index 1d73716..70aa152 100644 --- a/test/marpit.js +++ b/test/marpit.js @@ -336,6 +336,25 @@ describe('Marpit', () => { }), ) }) + + describe('Advanced background image powered by inline SVG mode', () => { + it('has figure element with background-image in the isolated layer', async () => { + const $ = load( + new Marpit({ inlineSVG: true }).render('![bg Advanced](test)').html, + ) + + const figure = $('figure') + const ret = await postcssInstance.process(figure.attr('style'), { + from: undefined, + }) + + ret.root.walkDecls('background-image', (decl) => { + expect(decl.value).toBe('url("test")') + }) + + expect(figure.find('figcaption').text()).toBe('Advanced') + }) + }) }) describe('CSS Filters', () => {