Files
kucherenko__jscpd/fixtures/tt2/file1.tt2
apk 64e471e2b0 test: raise coverage to 96%+ on @jscpd/finder and 98%+ on apps/jscpd
Adds 92 new tests (178 → 270 total) with zero source-file modifications:

- packages/finder: 13 new test files covering all reporters, subscribers,
  validators, hooks, utils, options, cloneFound, getFilesToDetect, and
  InFilesDetector; shared buildClone() factory helper
- apps/jscpd: 3 new test files (options-unit, print, store) plus extensions
  to formats, modes, and options integration tests
- vitest.config.ts added to both packages to restrict coverage.include
  to src/** only, eliminating bin/ and prism.js noise
- Fixes 3 tokenizer bugs (trailing space in format lookup, tokenization
  edge cases) uncovered by the new format fixture suite
- Adds fixture files for 40+ language formats to support formats.test.ts
2026-05-09 15:00:38 +02:00

53 lines
1.8 KiB
Plaintext

[% # Template Toolkit 2 - E-commerce product listing template %]
[% META
title = 'Product Catalog'
author = 'Shop Team'
version = '1.0'
%]
[% INCLUDE header.tt2 title = "Product Catalog" %]
<main class="catalog">
<h1>Our Products</h1>
[% IF products.size > 0 %]
<div class="product-grid">
[% FOREACH product IN products %]
<article class="product-card" id="product-[% product.id %]">
<img src="[% product.image_url | html %]"
alt="[% product.name | html %]"
loading="lazy" />
<div class="product-info">
<h2 class="product-name">[% product.name | html %]</h2>
<p class="product-description">[% product.description | truncate(120) %]</p>
<div class="product-meta">
<span class="price">[% product.price | format('$%.2f') %]</span>
[% IF product.discount > 0 %]
<span class="original-price">
[% product.original_price | format('$%.2f') %]
</span>
<span class="discount-badge">-[% product.discount %]%</span>
[% END %]
</div>
<div class="stock-status">
[% IF product.in_stock %]
<span class="in-stock">In Stock ([% product.stock_count %])</span>
[% ELSE %]
<span class="out-of-stock">Out of Stock</span>
[% END %]
</div>
<button class="add-to-cart"
data-id="[% product.id %]"
[% UNLESS product.in_stock %]disabled[% END %]>
Add to Cart
</button>
</div>
</article>
[% END %]
</div>
[% ELSE %]
<p class="no-products">No products found.</p>
[% END %]
</main>
[% INCLUDE footer.tt2 %]