Skip to content

Commit

Permalink
Merge pull request #3354 from ResuBaka/fix-jest-and-ssr
Browse files Browse the repository at this point in the history
Fixed rendering after jest watch fix destroyed it.
  • Loading branch information
pkarw authored Aug 12, 2019
2 parents 2807478 + 1ffeb98 commit f6b79e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 4 additions & 6 deletions src/themes/default/store/promoted-offers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)()
Expand All @@ -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)()
Expand Down

0 comments on commit f6b79e7

Please sign in to comment.