Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STRF-7393 fix renderTheme function to work with Stencil CLI #181

Merged

Conversation

bc-williamkwon
Copy link
Contributor

Previously, renderTheme function would not work properly when an ajax call resulted in having a templatePath with multiple templates. This fix should allow it to work now.

https://jira.bigcommerce.com/browse/STRF-7393

@bc-williamkwon bc-williamkwon force-pushed the fixRenderThemeFunction branch 3 times, most recently from 50d977a to 5e6768e Compare October 3, 2019 19:10
const themeComponents = ['pages/product', 'pages/partial', 'pages/greet', 'pages/pre'];

it('should render theme', function(done) {
const paper = new Paper(null, null, assembler);
Copy link
Contributor

@ncheikh ncheikh Oct 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test cover the case we were seeing with partials not be rendered?

Copy link
Contributor Author

@bc-williamkwon bc-williamkwon Oct 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pages/partial is in pages/product and its content is part of the value for pages/product in the object. The issue with renderTheme function was that the for in loop was using numeric indices and thus not grabbing the actual values of elements in templatePath.

index.js Outdated Show resolved Hide resolved
@bc-williamkwon bc-williamkwon force-pushed the fixRenderThemeFunction branch from 5e6768e to 3e6f8c3 Compare October 3, 2019 19:53
@bc-williamkwon bc-williamkwon force-pushed the fixRenderThemeFunction branch from 3e6f8c3 to 57f3a38 Compare October 3, 2019 19:59
@bc-williamkwon bc-williamkwon merged commit 1a7f330 into bigcommerce:master Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants