Skip to content

Commit

Permalink
#3 fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bennobuilder committed Sep 11, 2024
1 parent e2674c1 commit a872fe0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion packages/sfy-utils/src/__tests__/playground.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ describe('playground', () => {
criteria: (node: AST.LiquidHtmlNode) => {
if (node.type === AST.NodeTypes.LiquidTag && node.name === 'if') {
const markup = node.markup as AST.LiquidConditionalExpression;
if (markup.type === AST.NodeTypes.VariableLookup && markup.name === 'show_rating') {
if (
markup.type === AST.NodeTypes.LogicalExpression &&
markup.relation === 'and' &&
markup.left.type === AST.NodeTypes.VariableLookup &&
markup.left.name === 'show_rating'
) {
return true;
}
}
Expand All @@ -37,6 +42,8 @@ describe('playground', () => {

console.log(result);

// await writeFile(`${__dirname}/resources/created.liquid`, result);

expect(result).not.toBeNull();
});
});
2 changes: 1 addition & 1 deletion packages/sfy-utils/src/__tests__/resources/simple.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class='product-card'>
<h2>{{ card_product.title }}</h2>
{%- if show_rating -%}
{%- if show_rating and card_product.metafields.reviews.rating.value != blank -%}
<div class='rating'>{{ card_product.rating }}</div>
{%- endif -%}
<p>{{ card_product.price | money }}</p>
Expand Down

0 comments on commit a872fe0

Please sign in to comment.