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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/content_editor/markdown_processing_spec.js')
-rw-r--r--spec/frontend/content_editor/markdown_processing_spec.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/frontend/content_editor/markdown_processing_spec.js b/spec/frontend/content_editor/markdown_processing_spec.js
index cb34476d680..028cd6a8271 100644
--- a/spec/frontend/content_editor/markdown_processing_spec.js
+++ b/spec/frontend/content_editor/markdown_processing_spec.js
@@ -3,11 +3,15 @@ import { loadMarkdownApiExamples, loadMarkdownApiResult } from './markdown_proce
describe('markdown processing', () => {
// Ensure we generate same markdown that was provided to Markdown API.
- it.each(loadMarkdownApiExamples())('correctly handles %s', async (testName, markdown) => {
- const { html } = loadMarkdownApiResult(testName);
- const contentEditor = createContentEditor({ renderMarkdown: () => html });
- await contentEditor.setSerializedContent(markdown);
+ it.each(loadMarkdownApiExamples())(
+ 'correctly handles %s (context: %s)',
+ async (name, context, markdown) => {
+ const testName = context ? `${context}_${name}` : name;
+ const { html, body } = loadMarkdownApiResult(testName);
+ const contentEditor = createContentEditor({ renderMarkdown: () => html || body });
+ await contentEditor.setSerializedContent(markdown);
- expect(contentEditor.getSerializedContent()).toBe(markdown);
- });
+ expect(contentEditor.getSerializedContent()).toBe(markdown);
+ },
+ );
});