diff --git a/CHANGELOG.md b/CHANGELOG.md index 664cb0e629..4e2316ac5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added support for tax calculation where the values from customer_tax_class_ids is used - @resubaka (#3245) - Added loading product attributes (`entities.productListWithChildren.includeFields`) on category page - @andrzejewsky (#3220) - Added config to set Cache-Control header for static assets based on mime type - @phoenix-bjoern (#3268) -- Added test:unit:watch with a workaround of a jest problem with template strings - @resubaka (#3351) +- Added test:unit:watch with a workaround of a jest problem with template strings - @resubaka (#3351, #3354) ### Fixed diff --git a/src/themes/default/store/promoted-offers.ts b/src/themes/default/store/promoted-offers.ts index e3cdaa9786..a118f9b297 100644 --- a/src/themes/default/store/promoted-offers.ts +++ b/src/themes/default/store/promoted-offers.ts @@ -29,9 +29,8 @@ export const promotedStore = { async updatePromotedOffers ({commit, rootState}, data) { let promotedBannersResource = rootState.storeView && rootState.storeView.storeCode ? `banners/${rootState.storeView.storeCode}_promoted_offers` : `promoted_offers` try { - // Workaround to get jest --watch to work - const promotedBannersResourceImport = `theme/resource/${promotedBannersResource}.json` - const promotedOffersModule = await import(/* webpackChunkName: "vsf-promoted-offers-[request]" */ promotedBannersResourceImport) + // Workaround to get jest --watch to work so don't change the import sting to a template string + const promotedOffersModule = await import(/* webpackChunkName: "vsf-promoted-offers-[request]" */ 'theme/resource/' + promotedBannersResource + '.json') commit('updatePromotedOffers', promotedOffersModule) } catch (err) { Logger.debug('Unable to load promotedOffers' + err)() @@ -40,9 +39,8 @@ export const promotedStore = { async updateHeadImage ({commit, rootState}, data) { let mainImageResource = rootState.storeView && rootState.storeView.storeCode ? `banners/${rootState.storeView.storeCode}_main-image` : `main-image` try { - // Workaround to get jest --watch to work - const mainImageResourceImport = `theme/resource/${mainImageResource}.json` - const imageModule = await import(/* webpackChunkName: "vsf-head-img-[request]" */ mainImageResourceImport) + // Workaround to get jest --watch to work so don't change the import sting to a template string + const imageModule = await import(/* webpackChunkName: "vsf-head-img-[request]" */ 'theme/resource/' + mainImageResource + '.json') commit('SET_HEAD_IMAGE', imageModule.image) } catch (err) { Logger.debug('Unable to load headImage' + err)()