diff --git a/src/context/yaml/handlers/branding.ts b/src/context/yaml/handlers/branding.ts index 77efa1e8d..44f9711f0 100644 --- a/src/context/yaml/handlers/branding.ts +++ b/src/context/yaml/handlers/branding.ts @@ -19,8 +19,12 @@ type ParsedBranding = { async function parse(context: YAMLContext): Promise { // Load the HTML file for each page - //@ts-ignore - if (!context.assets.branding) return { branding: undefined }; + if (!context.assets.branding) + return { + branding: { + templates: [], + }, + }; const { branding: { templates, ...branding }, diff --git a/test/context/directory/branding.test.js b/test/context/directory/branding.test.js index c04e00714..47eea6738 100644 --- a/test/context/directory/branding.test.js +++ b/test/context/directory/branding.test.js @@ -21,7 +21,7 @@ const brandingSettings = JSON.stringify({ }); describe('#directory context branding', () => { - it('should process templates', async () => { + it('should process branding settings, including templates', async () => { const dir = path.join(testDataDir, 'directory', 'branding-process'); cleanThenMkdir(dir); const brandingDir = path.join(dir, constants.BRANDING_DIRECTORY); @@ -50,7 +50,7 @@ describe('#directory context branding', () => { ]); }); - it('should dump templates', async () => { + it('should dump branding settings, including templates', async () => { const repoDir = path.join(testDataDir, 'directory', 'branding-dump'); cleanThenMkdir(repoDir); const context = new Context({ AUTH0_INPUT_FILE: repoDir }, mockMgmtClient()); diff --git a/test/context/yaml/branding.test.js b/test/context/yaml/branding.test.js index a862ac597..fc90ffa16 100644 --- a/test/context/yaml/branding.test.js +++ b/test/context/yaml/branding.test.js @@ -10,7 +10,7 @@ const html = '##foo##'; const htmlTransformed = 'bar'; describe('#YAML context branding templates', () => { - it('should process branding templates', async () => { + it('should process branding settings, including templates', async () => { const dir = path.join(testDataDir, 'yaml', 'branding-process'); cleanThenMkdir(dir); @@ -39,7 +39,7 @@ describe('#YAML context branding templates', () => { ]); }); - it('should dump branding templates', async () => { + it('should dump branding settings, including templates', async () => { const dir = path.join(testDataDir, 'yaml', 'branding-dump'); cleanThenMkdir(dir); const context = new Context(