5180 fichiers 38.5 Mo 0 téléchargements 540 vues mis à jour il y a 8 heures ui
nitro-v36-with-renderer-v36 / src / components / catalog / views / page / layout / CatalogProductViewStructure.test.ts
CatalogProductViewStructure.test.ts 1.4 Ko Télécharger le fichier
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';

const readSource = (relativePath: string) => readFileSync(resolve(process.cwd(), relativePath), 'utf8');

describe('standard catalog product view structure', () => {
    it('keeps the 360px product canvas intact and overlays product copy on it', () => {
        const layoutSource = readSource('src/components/catalog/views/page/layout/CatalogLayoutDefaultView.tsx');
        const experienceCss = readSource('src/css/catalog/CatalogExperience.css');

        expect(layoutSource).not.toContain('octane-catalog-offer-info');
        expect(layoutSource).toMatch(/octane-catalog-offer-preview[\s\S]*CatalogProductDetailsView/);
        expect(layoutSource).toMatch(/octane-catalog-preview-limited[\s\S]*CatalogLimitedItemWidgetView/);
        expect(experienceCss).not.toContain('238px');
        expect(experienceCss).toContain('.octane-catalog-preview-details');
        expect(experienceCss).toMatch(
            /octane-catalog-offer-preview:not\(\.is-badge\)[\s\S]*octane-catalog-product-details-description[\s\S]*color:\s*#fff\s*!important/
        );
        expect(experienceCss).toMatch(/octane-catalog-grid-shell\s*\{[\s\S]*bottom: 60px/);
        expect(experienceCss).toMatch(/octane-catalog-price-row\s*\{[\s\S]*bottom: 30px/);
        expect(experienceCss).toMatch(/octane-catalog-purchase-row\s*\{[\s\S]*bottom: 0/);
    });
});
15Sujets
1Dépôts
20Membres
4En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser