Skip to content

Commit

Permalink
Add test for the default cssContainerQuery option
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Oct 15, 2023
1 parent 7a68978 commit 52f9e0a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/marp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,30 @@ describe('Marp', () => {
})
})

describe('Marpit options', () => {
describe('cssContainerQuery option', () => {
it('is enabled by default', () => {
const { css } = marp().render('')
expect(css).toContain('container-type:size')
})

it('can disable by setting cssContainerQuery constructor option as false', () => {
const { css } = marp({ cssContainerQuery: false }).render('')
expect(css).not.toContain('container-type')
})

it('can assign container name by setting cssContainerQuery constructor option as string or the array of strings', () => {
const single = marp({ cssContainerQuery: 'name' }).render('')
expect(single.css).toContain('container-type:size')
expect(single.css).toContain('container-name:name')

const multi = marp({ cssContainerQuery: ['name1', 'name2'] }).render('')
expect(multi.css).toContain('container-type:size')
expect(multi.css).toContain('container-name:name1 name2')
})
})
})

describe('emoji option', () => {
describe('shortcode option', () => {
it('converts emoji shorthand to twemoji image by default', () => {
Expand Down

0 comments on commit 52f9e0a

Please sign in to comment.