diff --git a/src/context/yaml/handlers/branding.ts b/src/context/yaml/handlers/branding.ts index 109a86c43..7260d883c 100644 --- a/src/context/yaml/handlers/branding.ts +++ b/src/context/yaml/handlers/branding.ts @@ -32,12 +32,8 @@ async function parse(context: YAMLContext): Promise { const parsedTemplates: BrandingTemplate[] = templates.map( (templateDefinition: BrandingTemplate): BrandingTemplate => { - const brandingTemplatesFolder = path.join( - context.basePath, - constants.BRANDING_TEMPLATES_YAML_DIRECTORY - ); - const file = `${templateDefinition.template}.html`; - const markupFile = path.join(brandingTemplatesFolder, file); + const normalizedPathSplit = path.normalize(templateDefinition.body).split(path.sep); + const markupFile = path.join(context.basePath, ...normalizedPathSplit); return { template: templateDefinition.template, body: loadFileAndReplaceKeywords(markupFile, { diff --git a/test/context/yaml/branding.test.js b/test/context/yaml/branding.test.js index 3e0e793f9..62b438d09 100644 --- a/test/context/yaml/branding.test.js +++ b/test/context/yaml/branding.test.js @@ -34,7 +34,6 @@ describe('#YAML context branding templates', () => { const config = { AUTH0_INPUT_FILE: yamlFile, AUTH0_KEYWORD_REPLACE_MAPPINGS: { foo: 'bar' } }; const context = new Context(config, mockMgmtClient()); - context.basePath = baseDir; await context.loadAssetsFromLocal(); expect(context.assets.branding).to.deep.equal({ colors: {