debian-mirror-gitlab/spec/frontend/content_editor/extensions/blockquote_spec.js
2021-11-11 11:23:49 +05:30

19 lines
582 B
JavaScript

import { multilineInputRegex } from '~/content_editor/extensions/blockquote';
describe('content_editor/extensions/blockquote', () => {
describe.each`
input | matches
${'>>> '} | ${true}
${' >>> '} | ${true}
${'\t>>> '} | ${true}
${'>> '} | ${false}
${'>>>x '} | ${false}
${'> '} | ${false}
`('multilineInputRegex', ({ input, matches }) => {
it(`${matches ? 'matches' : 'does not match'}: "${input}"`, () => {
const match = new RegExp(multilineInputRegex).test(input);
expect(match).toBe(matches);
});
});
});