Merge pull request #5146 from naturalcrit/Fix-homebrewery.api-tests

Fix homebrewery.api tests
This commit is contained in:
Trevor Buckner
2026-10-22 12:43:47 -04:00
committed by GitHub
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 };
text = `\`\`\`metadata\n` +
`${yaml.dump(metadata)}\n` +
`${yaml.dump(metadata)}` +
`\`\`\`\n\n` +
`${text}`;
return text;
+14 -14
View File
@@ -1,6 +1,7 @@
/* eslint-disable max-lines */
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
import dedent from 'dedent';
describe('Tests for api', ()=>{
let api;
@@ -493,7 +494,8 @@ describe('Tests for api', ()=>{
},
});
expect(result).toEqual(`\`\`\`metadata
expect(result).toEqual(dedent`
\`\`\`metadata
title: some title
description: this is a description
tags:
@@ -501,6 +503,10 @@ tags:
- fun
renderer: v3
theme: phb
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
bleedSize:
top: .125in
bottom: .125in
@@ -514,11 +520,6 @@ safetySpace:
trimSize:
width: 8.5in
height: 11in
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
\`\`\`
brew`);
@@ -556,7 +557,8 @@ brew`);
},
});
expect(result).toEqual(`\`\`\`metadata
expect(result).toEqual(dedent`
\`\`\`metadata
title: some title
description: this is a description
tags:
@@ -564,6 +566,10 @@ tags:
- fun
renderer: v3
theme: phb
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
bleedSize:
top: .125in
bottom: .125in
@@ -577,11 +583,6 @@ safetySpace:
trimSize:
width: 8.5in
height: 11in
columns: '2'
columnGutter: .125in
license: None
legalAuthors: ''
\`\`\`
\`\`\`css
@@ -704,12 +705,11 @@ brew`);
'title: asdf\n' +
'bleedSize: {}\n' +
'safetySpace: {}\n' +
'trimSize: {}\n' +
'trimSize: {}' +
'\n' +
'```\n' +
'\n' +
'asdf',
textBin : undefined,
theme : '5ePHB',
thumbnail : '',
title : 'asdf',