Skip to content

Commit 2fe2941

Browse files
committed
Create failing test
The test shows that changes to the `level` attribute of a markdown header button aren't reflected in the output when pressing the button.
1 parent 314ae02 commit 2fe2941

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,18 @@ describe('markdown-toolbar-element', function () {
831831
})
832832

833833
describe('header', function () {
834+
it('sets the level correctly even when dynamically created', function () {
835+
const headerElement = document.createElement('md-header')
836+
headerElement.setAttribute('level', '2')
837+
headerElement.textContent = 'h2'
838+
const toolbar = document.querySelector('markdown-toolbar')
839+
toolbar.appendChild(headerElement)
840+
841+
setVisualValue('|title|')
842+
clickToolbar('md-header[level="2"]')
843+
assert.equal('## |title|', visualValue())
844+
})
845+
834846
it('inserts header syntax with cursor in description', function () {
835847
setVisualValue('|title|')
836848
clickToolbar('md-header')

0 commit comments

Comments
 (0)