Fix tests for metadata order changed

This commit is contained in:
Trevor Buckner
2026-10-22 16:36:00 +00:00
parent 6b8fc41404
commit 720aaba3b3
2 changed files with 62 additions and 62 deletions
+1 -1
View File
@@ -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;
+14 -14
View File
@@ -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,7 +494,8 @@ describe('Tests for api', ()=>{
}, },
}); });
expect(result).toEqual(`\`\`\`metadata expect(result).toEqual(dedent`
\`\`\`metadata
title: some title title: some title
description: this is a description description: this is a description
tags: tags:
@@ -501,6 +503,10 @@ tags:
- fun - fun
renderer: v3 renderer: v3
theme: phb theme: phb
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
bleedSize: bleedSize:
top: .125in top: .125in
bottom: .125in bottom: .125in
@@ -514,11 +520,6 @@ safetySpace:
trimSize: trimSize:
width: 8.5in width: 8.5in
height: 11in height: 11in
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
\`\`\` \`\`\`
brew`); brew`);
@@ -556,7 +557,8 @@ brew`);
}, },
}); });
expect(result).toEqual(`\`\`\`metadata expect(result).toEqual(dedent`
\`\`\`metadata
title: some title title: some title
description: this is a description description: this is a description
tags: tags:
@@ -564,6 +566,10 @@ tags:
- fun - fun
renderer: v3 renderer: v3
theme: phb theme: phb
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
bleedSize: bleedSize:
top: .125in top: .125in
bottom: .125in bottom: .125in
@@ -577,11 +583,6 @@ safetySpace:
trimSize: trimSize:
width: 8.5in width: 8.5in
height: 11in height: 11in
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
\`\`\` \`\`\`
\`\`\`css \`\`\`css
@@ -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',