From 1f8f7ed0bc873891a9c90eb199861e901488a904 Mon Sep 17 00:00:00 2001 From: Tobias Sorn Date: Wed, 30 Oct 2019 09:18:05 +0100 Subject: [PATCH] [INTERNAL] fix tests --- lib/processors/themeBuilder.js | 2 +- lib/tasks/buildThemes.js | 5 +++-- .../resources/theme/j/themes/somefancytheme/library-RTL.css | 4 +--- .../theme/j/themes/somefancytheme/library-parameters.json | 2 +- .../dest/resources/theme/j/themes/somefancytheme/library.css | 4 +--- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/processors/themeBuilder.js b/lib/processors/themeBuilder.js index 2d81fef9a..a0446f9d1 100644 --- a/lib/processors/themeBuilder.js +++ b/lib/processors/themeBuilder.js @@ -68,7 +68,7 @@ class ThemeBuilder { const libParams = new Resource({ path: themeDir + "/library-parameters.json", - string: JSON.stringify(result.variables, null, compress || compressJSON ? null : "\t") + string: JSON.stringify(result.variables, null, (compress || compressJSON) ? null : "\t") }); files.push(libCss, libCssRtl, libParams); diff --git a/lib/tasks/buildThemes.js b/lib/tasks/buildThemes.js index eed4800e6..02d50cfda 100644 --- a/lib/tasks/buildThemes.js +++ b/lib/tasks/buildThemes.js @@ -55,14 +55,15 @@ module.exports = async function({workspace, dependencies, options}) { resources = await allResources.filter(isAvailable); } + const compress = options.compress !== false; const processedResources = await themeBuilder({ resources, fs: fsInterface(combo), options: { - compressJSON: true + compressJSON: compress, + compress: false } }); - const compress = options.compress !== false; if (compress) { const cssResources = processedResources.filter((resource) => { return resource.getPath().endsWith(".css"); diff --git a/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-RTL.css b/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-RTL.css index 5009ca50e..99082b7fd 100644 --- a/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-RTL.css +++ b/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-RTL.css @@ -1,3 +1 @@ -.someClass{color:#000} -/* Inline theming parameters */ -#sap-ui-theme-theme\.j{background-image:url('data:text/plain;utf-8,%7B%22someColor%22%3A%22%23000%22%7D')} +.someClass{color:#000000}#sap-ui-theme-theme\.j{background-image:url(data:text/plain;utf-8,%7B%22someColor%22%3A%22%23000000%22%7D)} \ No newline at end of file diff --git a/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-parameters.json b/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-parameters.json index a190cda03..96cecdfae 100644 --- a/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-parameters.json +++ b/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library-parameters.json @@ -1 +1 @@ -{"someColor":"#000"} \ No newline at end of file +{"someColor":"#000000"} \ No newline at end of file diff --git a/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library.css b/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library.css index 5009ca50e..99082b7fd 100644 --- a/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library.css +++ b/test/expected/build/theme.j/dest/resources/theme/j/themes/somefancytheme/library.css @@ -1,3 +1 @@ -.someClass{color:#000} -/* Inline theming parameters */ -#sap-ui-theme-theme\.j{background-image:url('data:text/plain;utf-8,%7B%22someColor%22%3A%22%23000%22%7D')} +.someClass{color:#000000}#sap-ui-theme-theme\.j{background-image:url(data:text/plain;utf-8,%7B%22someColor%22%3A%22%23000000%22%7D)} \ No newline at end of file