Welcome to mirror list, hosted at ThFree Co, Russian Federation.

blockquote_spec.js « extensions « content_editor « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c5b5044352d366a6a5ba1cda034a52829c2e3217 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
    });
  });
});