import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';

describe('product center layout', () => {
  it('removes the sidebar left edge and extends filter dividers to the viewport right', () => {
    const source = readFileSync(
      resolve(process.cwd(), 'app/pages/product-center.vue'),
      'utf8',
    );

    expect(source).not.toMatch(/\.sidebar-shell\s*\{[^}]*border-left:/u);
    expect(source).toContain('.countries::after, .filter-tools::after');
    expect(source).toContain('right: calc(-1 * var(--page-gutter))');
    expect(source).toContain('left: 0');
    expect(source).toContain('height: 1px');
    expect(source).toContain('background: #e5e7eb');
  });

  it('adds breathing room between root category rows', () => {
    const source = readFileSync(
      resolve(process.cwd(), 'app/components/product/ProductSidebar.vue'),
      'utf8',
    );

    expect(source).toMatch(/\.root-row\s*\{[^}]*margin-bottom:\s*10px/u);
  });
});
