All files / src/views shop.js

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14        1x   1x           1x  
import { getProducts } from '../products.js';
import { productCard } from './product-card.js';
 
export function renderShop(app) {
  const grid = getProducts().map(productCard).join('');
 
  app.innerHTML = `
    <h1 class="text-xl font-semibold text-gray-800 mb-6">Products</h1>
    <div data-testid="product-grid" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">${grid}</div>
  `;
}
 
export const shopView = { name: 'shop', mount: renderShop };