mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 22:38:43 +00:00
Fix tests for metadata order changed
This commit is contained in:
@@ -208,7 +208,7 @@ const api = {
|
|||||||
metadata.trimSize = { width: brew?.trimSize?.width, height: brew?.trimSize?.height };
|
metadata.trimSize = { width: brew?.trimSize?.width, height: brew?.trimSize?.height };
|
||||||
|
|
||||||
text = `\`\`\`metadata\n` +
|
text = `\`\`\`metadata\n` +
|
||||||
`${yaml.dump(metadata)}\n` +
|
`${yaml.dump(metadata)}` +
|
||||||
`\`\`\`\n\n` +
|
`\`\`\`\n\n` +
|
||||||
`${text}`;
|
`${text}`;
|
||||||
return text;
|
return text;
|
||||||
|
|||||||
+37
-37
@@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
||||||
|
import dedent from 'dedent';
|
||||||
|
|
||||||
describe('Tests for api', ()=>{
|
describe('Tests for api', ()=>{
|
||||||
let api;
|
let api;
|
||||||
@@ -493,35 +494,35 @@ describe('Tests for api', ()=>{
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual(`\`\`\`metadata
|
expect(result).toEqual(dedent`
|
||||||
title: some title
|
\`\`\`metadata
|
||||||
description: this is a description
|
title: some title
|
||||||
tags:
|
description: this is a description
|
||||||
|
tags:
|
||||||
- something
|
- something
|
||||||
- fun
|
- fun
|
||||||
renderer: v3
|
renderer: v3
|
||||||
theme: phb
|
theme: phb
|
||||||
bleedSize:
|
columns: '2'
|
||||||
|
columnGutter: .125in
|
||||||
|
license: None
|
||||||
|
legalAuthors: ''
|
||||||
|
bleedSize:
|
||||||
top: .125in
|
top: .125in
|
||||||
bottom: .125in
|
bottom: .125in
|
||||||
inner: .125in
|
inner: .125in
|
||||||
outer: .125in
|
outer: .125in
|
||||||
safetySpace:
|
safetySpace:
|
||||||
top: .25in
|
top: .25in
|
||||||
bottom: .25in
|
bottom: .25in
|
||||||
outer: .25in
|
outer: .25in
|
||||||
inner: .5in
|
inner: .5in
|
||||||
trimSize:
|
trimSize:
|
||||||
width: 8.5in
|
width: 8.5in
|
||||||
height: 11in
|
height: 11in
|
||||||
columns: '2'
|
\`\`\`
|
||||||
columnGutter: .125in
|
|
||||||
license: None
|
|
||||||
legalAuthors: ''
|
|
||||||
|
|
||||||
\`\`\`
|
brew`);
|
||||||
|
|
||||||
brew`);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should set metadata and style', ()=>{
|
it('should set metadata and style', ()=>{
|
||||||
@@ -556,39 +557,39 @@ brew`);
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual(`\`\`\`metadata
|
expect(result).toEqual(dedent`
|
||||||
title: some title
|
\`\`\`metadata
|
||||||
description: this is a description
|
title: some title
|
||||||
tags:
|
description: this is a description
|
||||||
|
tags:
|
||||||
- something
|
- something
|
||||||
- fun
|
- fun
|
||||||
renderer: v3
|
renderer: v3
|
||||||
theme: phb
|
theme: phb
|
||||||
bleedSize:
|
columns: '2'
|
||||||
|
columnGutter: .125in
|
||||||
|
license: None
|
||||||
|
legalAuthors: ''
|
||||||
|
bleedSize:
|
||||||
top: .125in
|
top: .125in
|
||||||
bottom: .125in
|
bottom: .125in
|
||||||
inner: .125in
|
inner: .125in
|
||||||
outer: .125in
|
outer: .125in
|
||||||
safetySpace:
|
safetySpace:
|
||||||
top: .25in
|
top: .25in
|
||||||
bottom: .25in
|
bottom: .25in
|
||||||
outer: .25in
|
outer: .25in
|
||||||
inner: .5in
|
inner: .5in
|
||||||
trimSize:
|
trimSize:
|
||||||
width: 8.5in
|
width: 8.5in
|
||||||
height: 11in
|
height: 11in
|
||||||
columns: '2'
|
\`\`\`
|
||||||
columnGutter: .125in
|
|
||||||
license: None
|
|
||||||
legalAuthors: ''
|
|
||||||
|
|
||||||
\`\`\`
|
\`\`\`css
|
||||||
|
hello yes i am css
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
\`\`\`css
|
brew`);
|
||||||
hello yes i am css
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
brew`);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('exclusion methods', ()=>{
|
describe('exclusion methods', ()=>{
|
||||||
@@ -704,12 +705,11 @@ brew`);
|
|||||||
'title: asdf\n' +
|
'title: asdf\n' +
|
||||||
'bleedSize: {}\n' +
|
'bleedSize: {}\n' +
|
||||||
'safetySpace: {}\n' +
|
'safetySpace: {}\n' +
|
||||||
'trimSize: {}\n' +
|
'trimSize: {}' +
|
||||||
'\n' +
|
'\n' +
|
||||||
'```\n' +
|
'```\n' +
|
||||||
'\n' +
|
'\n' +
|
||||||
'asdf',
|
'asdf',
|
||||||
textBin : undefined,
|
|
||||||
theme : '5ePHB',
|
theme : '5ePHB',
|
||||||
thumbnail : '',
|
thumbnail : '',
|
||||||
title : 'asdf',
|
title : 'asdf',
|
||||||
|
|||||||
Reference in New Issue
Block a user