Skip to content

Commit

Permalink
chore: add test case for supports vue bind attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
PBK-B committed Dec 12, 2024
1 parent 1aed2f8 commit 9342edf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/lexers/html-lexer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,26 @@ describe('HTMLLexer', () => {
])
done()
})

it('supports vue bind attributes', (done) => {
const Lexer = new HTMLLexer({
functions: ['t', '$t'],
vueBindAttr: true,
})
const content = `
<template>
<button :aria-label="t('b_a_l', 'button aria label')">
button label
</button>
<button v-aria-label="$t('button v-bind aria label')">
button label form v-bind
</button>
</template>
`
assert.deepEqual(Lexer.extract(content), [
{ key: 'b_a_l', defaultValue: 'button aria label' },
{ key: 'button v-bind aria label' },
])
done()
})
})

0 comments on commit 9342edf

Please sign in to comment.