-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
If we add the following test
it('returns expected object when only brand override URLs are present, fallback to PARAGON_THEME', () => {
const config = {
PARAGON_THEME_URLS: {
core: {
urls: {
brandOverride: 'https://www.example.com/example-brand-core.css',
},
},
defaults: {
light: 'light',
},
variants: {
light: {
urls: {
brandOverride: 'https://www.example.com/example-brand-light.css'
},
}
},
},
};
mergeConfig(config);
const { result } = renderHook(() => useParagonThemeUrls());
expect(result.current).toEqual(
expect.objectContaining({
core: {
urls: {
default: '//localhost:8080/local-core.min.css',
brandOverride: 'https://www.example.com/example-brand-core.css',
},
},
defaults: {
light: 'light',
},
variants: {
light: {
urls: {
default: '//localhost:8080/local-light.min.css',
brandOverride: 'https://www.example.com/example-brand-light.css',
},
},
},
}),
);
});to useParagonThemeUrls.test.js it will fail because actual result will have an undefined for default in light
@@ -10,10 +10,10 @@
},
"variants": Object {
"light": Object {
"urls": Object {
"brandOverride": "https://www.example.com/example-brand-light.css",
- "default": "//localhost:8080/local-light.min.css",
+ "default": undefined,
},
},
},
}Considering core handles not having a URL for default gracefully, it would be nice to have the variants handle that gracefully too.
dcoa
Metadata
Metadata
Assignees
Labels
No labels