diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/frontend/static_site_editor/services/front_matterify_spec.js | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/frontend/static_site_editor/services/front_matterify_spec.js')
-rw-r--r-- | spec/frontend/static_site_editor/services/front_matterify_spec.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/frontend/static_site_editor/services/front_matterify_spec.js b/spec/frontend/static_site_editor/services/front_matterify_spec.js index dbaedc30849..866897f21ef 100644 --- a/spec/frontend/static_site_editor/services/front_matterify_spec.js +++ b/spec/frontend/static_site_editor/services/front_matterify_spec.js @@ -11,6 +11,7 @@ describe('static_site_editor/services/front_matterify', () => { const frontMatterifiedContent = { source: content, matter: yamlFrontMatterObj, + hasMatter: true, spacing, content: body, delimiter: '---', @@ -19,6 +20,7 @@ describe('static_site_editor/services/front_matterify', () => { const frontMatterifiedBody = { source: body, matter: null, + hasMatter: false, spacing: null, content: body, delimiter: null, @@ -33,6 +35,12 @@ describe('static_site_editor/services/front_matterify', () => { `('returns $target from $frontMatterified', ({ frontMatterified, target }) => { expect(frontMatterified).toEqual(target); }); + + it('should throw when matter is invalid', () => { + const invalidContent = `---\nkey: val\nkeyNoVal\n---\n${body}`; + + expect(() => frontMatterify(invalidContent)).toThrow(); + }); }); describe('stringify', () => { |