Skip to content

Commit

Permalink
Add integrated unit testing for accessible advanced background image
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Sep 11, 2023
1 parent 16aaa4f commit ce50a28
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/marpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

0 comments on commit ce50a28

Please sign in to comment.