import { expect } from 'chai' import { extractionsParsers } from '../../../../src/extraction' const html = extractionsParsers.html describe('detections', () => { describe('attrs', () => { it('html', () => { expect(html.detect('
')).to.matchSnapshot() expect(html.detect(` `)).to.matchSnapshot() expect(html.detect('This is an alt.')).to.matchSnapshot() expect(html.detect('img.svg')).eql([]) }) it('vue-favored attrs', () => { expect(html.detect( // eslint-disable-next-line no-template-curly-in-string ''), ).to.matchSnapshot() }) }) describe('inline', () => { it('plain text', () => { expect(html.detect('

Popular Tags

')).to.matchSnapshot() }) it('mixed text', () => { expect(html.detect(`

Sign in or sign up to add comments on this article.

`)).to.matchSnapshot() }) it('vue-favored variables', () => { expect(html.detect('

Using mustaches: {{ rawHtml }}

')).to.matchSnapshot() }) it('ignore translated keys', () => { expect(html.detect('

{{ $t("hello.world") }}

').length).to.eq(0) expect(html.detect('

').length).to.eq(0) expect(html.detect('

').length).to.eq(0) }) it('multiple lines', () => { expect(html.detect(`

Using v-html directive:

`)).to.matchSnapshot() }) it('invalid', () => { expect(html.detect('

class.name

')).eql([]) expect(html.detect('

{{ $t("hello") }}

')).eql([]) }) it('exclude tag', () => { expect(html.detect('')).eql([]) expect(html.detect('')).eql([]) }) }) })